- 11 Aug, 2019 2 commits
-
-
stash: avoid recomputing tree when committing worktree
Edward Thomson committed -
Variadic macros
Edward Thomson committed
-
- 09 Aug, 2019 1 commit
-
-
Add sign capability to git_rebase_commit
Patrick Steinhardt committed
-
- 07 Aug, 2019 1 commit
-
-
Tyler Ang-Wanek committed
-
- 02 Aug, 2019 4 commits
-
-
remote: remove unused block of code
Edward Thomson committed -
Adjust printf specifiers in examples code
Patrick Steinhardt committed -
In "remote.c", we have a chunk of code that is #ifdef'fed out via `#if 0` with a comment that we could export it as a helper function. The code was implemented in 2013 and ifdef'fed in 2014, which shows that there's clearly no interest in having such a helper at all. As this block has recently created some confusion about `p_getenv` due to it containing the only reference to that function in our codebase, let's remove this block altogether.
Patrick Steinhardt committed -
config: check if we are running in a sandboxed environment
Patrick Steinhardt committed
-
- 01 Aug, 2019 11 commits
-
-
Static analysis of example code found multiple findings of `printf` usage where filling value is members of git_indexer_progress object. Specifier used was for signed int but git_indexer_progress members are typed as unsigned ints. `printf` specifiers were altered to match type.
Scott Furry committed -
On macOS the $HOME environment variable returns the path to the sandbox container instead of the actual user $HOME for sandboxed apps. To get the correct path, we have to get it from the password file entry.
Erik Aigner committed -
Fix example checkout to forbid rather than require --
Patrick Steinhardt committed -
editorconfig: update to match our coding style
Patrick Steinhardt committed -
Compare buffers in diff example
Patrick Steinhardt committed -
The macro `p_snprintf` is implemented as a variadic macro that calls `snprintf` directly with `__VA_ARGS__`. In C89, variadic macros are not allowed, but as the arguments of `p_snprintf` and `snprintf` are matching 1:1, we can fix this by simply removing the parameter list from `p_snprintf`.
Patrick Steinhardt committed -
The macro `apply_err` is implemented as a variadic macro, which are not defined by C89. Convert it to a variadic function, instead.
Patrick Steinhardt committed -
The macro `git_parse_error` is implemented in a variadic way so that it's possible to pass printf-style parameters. Unfortunately, variadic macros are not defined by C89 and thus we cannot use that functionality. But as we have implemented `git_error_vset` in the previous commit, we can now just use that instead. Convert `git_parse_error` to a variadic function and use `git_error_vset` to fix the compliance violation. While at it, move the function to "patch_parse.c".
Patrick Steinhardt committed -
Right now, we only provide a `git_error_set` that has a variadic function signature. It's impossible to drive this function in a C89-compliant way from other functions that have a variadic signature, though, like for example `git_parse_error`. Implement a new `git_error_vset` function that gets a `va_list` as parameter, fixing the above problem.
Patrick Steinhardt committed -
Include ahead_behind in the test suite
Patrick Steinhardt committed -
config: separate file and snapshot backends
Patrick Steinhardt committed
-
- 29 Jul, 2019 2 commits
-
-
object: deprecate git_object__size for removal
Carlos Martín Nieto committed -
In #5118 we remove the double-underscore to make it a normally-named public function. However, this is not an interesting function outside of the library and it takes up a name for something that could be more useful. Remove the single-underscore version as we have not done any releases with it.
Carlos Martín Nieto committed
-
- 26 Jul, 2019 7 commits
-
-
The internal backend structures are kind-of legacy and do not really speak for themselves. Rename them accordingly to make them easier to understand.
Patrick Steinhardt committed -
To further distinguish the file writeable and readonly backends, separate the readonly backend into its own "config_snapshot.c" implementation. The snapshot backend can be generically used to snapshot any type of backend.
Patrick Steinhardt committed -
In `backend_readonly_free`, the passed in config backend is being cast to a `diskfile_backend` instead of to a `diskfile_readonly_backend`. While this works out just fine because we only access its header values, which were shared between both backends, it is undefined behaviour. Use the correct type to fix this.
Patrick Steinhardt committed -
The `diskfile_header` structure is shared between both `diskfile_backend` and `diskfile_readonly_backend`. The separation and resulting casting is confusing at times and a source for programming errors. Remove the shared structure and inline them directly.
Patrick Steinhardt committed -
While most functions of the readonly configuration backend are implemented separately from the writeable configuration backend, the two functions `config_iterator_new` and `config_get` are shared between both. This sharing makes it necessary to have some shared data structures, which is the `diskfile_header` structure. Unfortunately, this makes the backends harder to grasp than necessary due to all the casting between structs and also quite error prone. Reimplement those functions for the readonly backends. As readonly backends cannot be refreshed anyway, we can remove the calls to `config_refresh` in there.
Patrick Steinhardt committed -
The `config_readonly_open` function currently receives as input a diskfile backend and will copy its entries to a new snapshot. This is rather intimate, as we need to assume that the source config backend is in fact a diskfile entry. We can do better than this though by using generic methods to copy contents of the provided backend, e.g. by using a config iterator. This also allows us to decouple the read-only backend from the read-write backend.
Patrick Steinhardt committed -
When duplicating a configuration entry, we allocate a new entry but do not verify that we get a valid pointer back. As we're dereferencing the pointer afterwards, we might thus run into a segfault in out-of-memory situations. Extract a new function `git_config_entries_dup_entry` that handles the complete entry duplication. Fix the error by using `GIT_ERROR_CHECK_ALLOC`.
Patrick Steinhardt committed
-
- 24 Jul, 2019 2 commits
-
-
Make the example program for checkout follow git syntax, where "--" indicates a file. This was likely just a strcmp return value confusion.
David Turner committed -
Update editorconfig to match our coding style. Most importantly, we set up the tab width to be 8 characters instead of the default and use 2 spaces to indent YAML files.
Patrick Steinhardt committed
-
- 22 Jul, 2019 2 commits
-
-
Janardhan Pulivarthi committed
-
config_file: refresh when creating an iterator
Edward Thomson committed
-
- 21 Jul, 2019 5 commits
-
-
There was a bug when calling `git_remote_list` that caused us to not re-read modified configurations when using `git_config_iterator`. This bug also impacted `git_remote_list`, which thus failed to provide an up-to-date list of remotes. Add a test suite remote::list with a single test that verifies we do the right thing.
Jordan Wallet committed -
When creating a new iterator for a config file backend, then we should always make sure that we're up to date by calling `config_refresh`. Otherwise, we might not notice when another process has modified the configuration file and thus will represent outdated values. Add two tests to config::stress that verify that we get up-to-date values when reading configuration entries via `git_config_iterator`.
Patrick Steinhardt committed -
If calling `config_refresh` on a read-only configuration file backend, then we will segfault when comparing the timestamp of the file due to `path` being uninitialized. As a read-only snapshot should not be refreshed anyway and stay consistent, we can simply return early when calling `config_refresh` on a read-only snapshot.
Patrick Steinhardt committed -
Patrick Steinhardt committed
-
azure: drop powershell
Patrick Steinhardt committed
-
- 20 Jul, 2019 3 commits
-
-
fuzzer: use futils instead of fileops
Edward Thomson committed -
Edward Thomson committed
-
w32: fix unlinking of directory symlinks
Edward Thomson committed
-