- 01 Jun, 2018 6 commits
-
-
Carlos Martín Nieto committed
-
Carlos Martín Nieto committed
-
We might modify caches due to us trying to load the configuration to figure out what kinds of filesystem protections we should have.
Carlos Martín Nieto committed -
Any part of the library which asks the question can pass in the mode to have it checked against `.gitmodules` being a symlink. This is particularly relevant for adding entries to the index from the worktree and for checking out files.
Carlos Martín Nieto committed -
Otherwise we would also admit `..\..\foo\bar` as a valid path and fail to protect Windows users. Ideally we would check for both separators without the need for the copied string, but this'll get us over the RCE.
Carlos Martín Nieto committed -
If the we decide that the "name" of the submodule (i.e. its path inside `.git/modules/`) is trying to escape that directory or otherwise trick us, we ignore the configuration for that submodule. This leaves us with a half-configured submodule when looking it up by path, but it's the same result as if the configuration really were missing. The name check is potentially more strict than it needs to be, but it lets us re-use the check we're doing for the checkout. The function that encapsulates this logic is ready to be exported but we don't want to do that in a security release so it remains internal for now.
Carlos Martín Nieto committed
-
- 17 Mar, 2017 1 commit
-
-
It is possible to specify submodule URLs relative to the repository location. E.g. having a submodule with URL "../submodule" will look for the submodule at "repo/../submodule". With the introduction of worktrees, though, we cannot simply resolve the URL relative to the repository location itself. If the repository for which a URL is to be resolved is a working tree, we have to resolve the URL relative to the parent's repository path. Otherwise, the URL would change depending on where the working tree is located. Fix this by special-casing when we have a working tree while getting the URL base.
Patrick Steinhardt committed
-
- 14 Mar, 2017 1 commit
-
-
When calling `git_submodule_update` on a submodule, we have to retrieve the ID of the submodule entry in the index. If the function is called on a submodule which is only partly initialized, the submodule entry may not be added to the index yet. This leads to an assert when trying to look up the blob later on. Fix the issue by checking if the index actually holds the submodule's ID and erroring out if it does not.
Patrick Steinhardt committed
-
- 17 Feb, 2017 3 commits
-
-
Patrick Steinhardt committed
-
Patrick Steinhardt committed
-
Patrick Steinhardt committed
-
- 13 Feb, 2017 1 commit
-
-
The recent introduction of the commondir variable of a repository requires callers to distinguish whether their files are part of the dot-git directory or the common directory shared between multpile worktrees. In order to take the burden from callers and unify knowledge on which files reside where, the `git_repository_item_path` function has been introduced which encapsulate this knowledge. Modify most existing callers of `git_repository_path` to use `git_repository_item_path` instead, thus making them implicitly aware of the common directory.
Patrick Steinhardt committed
-
- 27 Jan, 2017 1 commit
-
-
Fix the following warning emitted by clang: [ 16%] Building C object CMakeFiles/libgit2_clar.dir/src/submodule.c.o /Users/mplough/devel/external/libgit2/src/submodule.c:408:6: warning: variable 'i' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if ((error = load_submodule_names(names, cfg))) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/mplough/devel/external/libgit2/src/submodule.c:448:20: note: uninitialized use occurs here git_iterator_free(i); ^ /Users/mplough/devel/external/libgit2/src/submodule.c:408:2: note: remove the 'if' if its condition is always false if ((error = load_submodule_names(names, cfg))) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/mplough/devel/external/libgit2/src/submodule.c:404:17: note: initialize the variable 'i' to silence this warning git_iterator *i; ^ = NULL 1 warning generated.
Matthew Plough committed
-
- 23 Jan, 2017 3 commits
-
-
Edward Thomson committed
-
When we fail to load submodules, don't free the list; it is later freed unconditionally.
Edward Thomson committed -
Etienne Samson committed
-
- 20 Jan, 2017 3 commits
-
-
`git_submodule_status` is very slow, bottlenecked on `git_repository_head_tree`, which it uses through `submodule_update_head`. If the user has requested submodule caching, assume that they want this status cached too and skip it. Signed-off-by: David Turner <dturner@twosigma.com>
Brock Peabody committed -
Added `git_repository_submodule_cache_all` to initialze a cache of submodules on the repository so that operations looking up N submodules are O(N) and not O(N^2). Added a `git_repository_submodule_cache_clear` function to remove the cache. Also optimized the function that loads all submodules as it was itself O(N^2) w.r.t the number of submodules, having to loop through the `.gitmodules` file once per submodule. I changed it to process the `.gitmodules` file once, into a map. Signed-off-by: David Turner <dturner@twosigma.com>
Brock Peabody committed -
Signed-off-by: David Turner <dturner@twosigma.com>
David Turner committed
-
- 29 Dec, 2016 1 commit
-
-
Error messages should be sentence fragments, and therefore: 1. Should not begin with a capital letter, 2. Should not conclude with punctuation, and 3. Should not end a sentence and begin a new one
Edward Thomson committed
-
- 09 Oct, 2016 2 commits
-
-
Remove overriding the `checkout_strategy` for `update_options` when performing an update on a submodule. Users should be specifying the correct checkout strategy in `update_options.checkout_opts.checkout_strategy`.
Josh Leeb-du Toit committed -
Remove `clone_checkout_strategy` in `git_submodule_update_options` as per issue #3784.
Josh Leeb-du Toit committed
-
- 28 Jun, 2016 1 commit
-
-
Jason Haslam committed
-
- 20 Mar, 2016 1 commit
-
-
Instead of copying over the data into the individual entries, point to the originals, which are already in a format we can use.
Carlos Martín Nieto committed
-
- 11 Mar, 2016 1 commit
-
-
In C89 it is undefined behavior to pass `NULL` pointers to `strncmp` and later on in C99 it has been explicitly stated that functions with an argument declared as `size_t nmemb` specifying the array length shall always have valid parameters, no matter if `nmemb` is 0 or not (see ISO 9899 §7.21.1.2). The function `str_equal_no_trailing_slash` always passes its parameters to `strncmp` if their lengths match. This means if one parameter is `NULL` and the other one either `NULL` or a string with length 0 we will pass the pointers to `strncmp` and cause undefined behavior. Fix this by explicitly handling the case when both lengths are 0.
Patrick Steinhardt committed
-
- 16 Feb, 2016 1 commit
-
-
Edward Thomson committed
-
- 11 Feb, 2016 1 commit
-
-
Arthur Schreiber committed
-
- 08 Dec, 2015 1 commit
-
-
This fits with the style for the rest of the project, but more importantly, makes life easier for bindings authors who auto-generate code.
joshaber committed
-
- 04 Nov, 2015 1 commit
-
-
Reload the HEAD and index data for a submodule after reading the configuration. The configuration may specify a `path`, so we must update HEAD and index data with that path in mind.
Edward Thomson committed
-
- 27 Sep, 2015 1 commit
-
-
Carlos Martín Nieto committed
-
- 24 Sep, 2015 1 commit
-
-
Carlos Martín Nieto committed
-
- 10 Sep, 2015 1 commit
-
-
When searching for information about a submdoule, let's be more explicit in what we expect to find. We currently insert a submodule into the map and change certain parameters when the config callback gets called. Switch to asking for the configuration we're interested in, rather than taking it in an arbitrary order.
Carlos Martín Nieto committed
-
- 28 Aug, 2015 1 commit
-
-
Edward Thomson committed
-
- 13 Jul, 2015 2 commits
-
-
Extract the backslash-to-slash conversion into a helper function.
Carlos Martín Nieto committed -
Our path functions expect to work with slashes, so convert a path with backslashes into one with slashes at the top of the function.
Carlos Martín Nieto committed
-
- 11 Jul, 2015 1 commit
-
-
If we get the path from the gitmodules file, look up the submodule we're interested in by path, rather then by name. Otherwise we might get duplicate results.
Carlos Martín Nieto committed
-
- 01 Jul, 2015 1 commit
-
-
The regex we use to look at the gitmodules file does not correctly delimit the name of submodule which we want to look up and puts '.*' straight after the name, maching on any submodule which has the seeked submodule as a prefix of its name. Add the missing '\.' in the regex so we want a full stop to exist both before and after the submodule name.
Carlos Martín Nieto committed
-
- 29 Jun, 2015 3 commits
-
-
Edward Thomson committed
-
We allow looking up a submodule by path, but we lost the path normalisation during the recent changes. Bring it back.
Carlos Martín Nieto committed -
Remove some of the logic that was left-over from the time we had a cache of submodules, plugging a leak of the submodule object in certain cases.
Carlos Martín Nieto committed
-