- 10 Apr, 2023 1 commit
-
-
Edward Thomson committed
-
- 23 Feb, 2022 1 commit
-
-
Like we want to separate libgit2 and utility source code, we want to separate libgit2 and utility tests. Start by moving all the tests into libgit2.
Edward Thomson committed
-
- 17 Oct, 2021 1 commit
-
-
libgit2 has two distinct requirements that were previously solved by `git_buf`. We require: 1. A general purpose string class that provides a number of utility APIs for manipulating data (eg, concatenating, truncating, etc). 2. A structure that we can use to return strings to callers that they can take ownership of. By using a single class (`git_buf`) for both of these purposes, we have confused the API to the point that refactorings are difficult and reasoning about correctness is also difficult. Move the utility class `git_buf` to be called `git_str`: this represents its general purpose, as an internal string buffer class. The name also is an homage to Junio Hamano ("gitstr"). The public API remains `git_buf`, and has a much smaller footprint. It is generally only used as an "out" param with strict requirements that follow the documentation. (Exceptions exist for some legacy APIs to avoid breaking callers unnecessarily.) Utility functions exist to convert a user-specified `git_buf` to a `git_str` so that we can call internal functions, then converting it back again.
Edward Thomson committed
-
- 15 Jun, 2021 1 commit
-
-
Dmitry Lobanov committed
-
- 03 Jun, 2021 1 commit
-
-
Dmitry Lobanov committed
-
- 20 Jul, 2019 1 commit
-
-
Our file utils functions all have a "futils" prefix, e.g. `git_futils_touch`. One would thus naturally guess that their definitions and implementation would live in files "futils.h" and "futils.c", respectively, but in fact they live in "fileops.h". Rename the files to match expectations.
Patrick Steinhardt committed
-
- 10 Jun, 2018 1 commit
-
-
Patrick Steinhardt committed
-
- 06 Jun, 2018 1 commit
-
-
The test submodule::lookup::duplicated_path, which tries to verify that we detect submodules with duplicated paths, currently relies on the gitmodules file of "submod2_target". While this file has two gitmodules with the same path, one of these gitmodules has an empty name and thus does not pass `git_submodule_name_is_valid`. Because of this, the test is in fact dependent on the iteration order in which we process the submodules. In fact the "valid" submodule comes first, the "invalid" submodule will cause the desired error. In fact the "invalid" submodule comes first, it will be skipped due to its name being invalid, and we will not see the desired error. While this works on the master branch just right due to the refactoring of our config code, where iteration order is now deterministic, this breaks on all older maintenance branches. Fix the issue by simply using `cl_git_rewritefile` to rewrite the gitmodules file. This greatly simplifies the test and also makes the intentions of it much clearer.
Patrick Steinhardt committed
-
- 30 May, 2018 1 commit
-
-
When loading submodule names, we build a map of submodule paths and their respective names. While looping over the configuration keys, we do not check though whether a submodule path was seen already. This leads to a memory leak in case we have multiple submodules with the same path, as we just overwrite the old value in the map in that case. Fix the error by verifying that the path to be added is not yet part of the string map. Git does not allow to have multiple submodules for a path anyway, so we now do the same and detect this duplication, reporting it to the user.
Patrick Steinhardt committed
-
- 27 Mar, 2018 1 commit
-
-
Signed-off-by: Sven Strickroth <email@cs-ware.de>
Sven Strickroth committed
-
- 25 Aug, 2017 3 commits
-
-
While it is technically possible to look up submodules inside of a bare repository by reading the submodule configuration of a specific commit, we do not offer this functionality right now. As such, calling both `git_submodule_lookup` and `git_submodule_foreach` should error out early when these functions encounter a bare repository. While `git_submodule_lookup` already does return an error due to not being able to parse the configuration, `git_submodule_foreach` simply returns success and never invokes the callback function. Fix the issue by having both functions check whether the repository is bare and returning an error in that case.
Patrick Steinhardt committed -
Patrick Steinhardt committed
-
The testcase "submodule::lookup::cached" was declared with a single underscore separating the test suide and test name, only. As the clar parser only catches tests with two underscores, it was never executed. Add in the second underscore to actually have it detected and executed.
Patrick Steinhardt committed
-
- 20 Jan, 2017 1 commit
-
-
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
-
- 21 Dec, 2015 1 commit
-
-
Dmitriy Olshevskiy committed
-
- 18 Sep, 2015 1 commit
-
-
Carlos Martín Nieto committed
-
- 10 Sep, 2015 1 commit
-
-
Carlos Martín Nieto committed
-
- 13 Jul, 2015 1 commit
-
-
Carlos Martín Nieto committed
-
- 11 Jul, 2015 1 commit
-
-
When we rename a submodule, we should be merging two sets of information based on whether their path is the same. We currently only deduplicate on equal name, which causes us to double-report.
Carlos Martín Nieto committed
-
- 01 Jul, 2015 1 commit
-
-
When two submodules are fairly similar, we may end up loading the wrong one.
Carlos Martín Nieto committed
-
- 29 Jun, 2015 1 commit
-
-
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
-
- 03 Mar, 2015 1 commit
-
-
The signature for the reflog is not something which changes dynamically. Almost all uses will be NULL, since we want for the repository's default identity to be used, making it noise. In order to allow for changing the identity, we instead provide git_repository_set_ident() and git_repository_ident() which allow a user to override the choice of signature.
Carlos Martín Nieto committed
-
- 22 Dec, 2014 1 commit
-
-
This introduces the functionality of submodule update in 'git_submodule_do_update'. The existing 'git_submodule_update' function is renamed to 'git_submodule_update_strategy'. The 'git_submodule_update' function now refers to functionality similar to `git submodule update`, while `git_submodule_update_strategy` is used to get the configured value of submodule.<name>.update.
Jameson Miller committed
-
- 01 Apr, 2014 2 commits
-
-
There was a little bug where the submodule cache thought that the index date was out of date even when it wasn't that was resulting in some extra scans of index data even when not needed. Mostly this commit adds a bunch of new tests including adding and removing submodules in the index and in the HEAD and seeing if we can automatically pick them up when refreshing.
Russell Belfer committed -
With the new submodule cache validity checks, we generally don't need to call git_submodule_reload_all to have up-to-date submodule data. Some tests are still calling it where I want to actually test that it can be called safely and doesn't break anything, but mostly it is not needed. This also expands some of the existing submodule tests to cover some variants on the behavior that was already being tested.
Russell Belfer committed
-
- 26 Mar, 2014 1 commit
-
-
When a submodule was inserted with a different path and name, the return value from khash greater than zero was allowed to propagate back out to the caller when it should really be zeroed. This led to a possible crash when reloading submodules if that was the first time that submodule data was loaded.
Russell Belfer committed
-
- 25 Mar, 2014 1 commit
-
-
`git_submodule` objects were already refcounted internally in case the submodule name was different from the path at which it was stored. This makes that refcounting externally used as well, so `git_submodule_lookup` and `git_submodule_add_setup` return an object that requires a `git_submodule_free` when done.
Russell Belfer committed
-
- 15 Jan, 2014 1 commit
-
-
Any well-behaved program should write a descriptive message to the reflog whenever it updates a reference. Let's make this more prominent by removing the version without the reflog parameters.
Carlos Martín Nieto committed
-
- 14 Nov, 2013 1 commit
-
-
Ben Straub committed
-
- 08 Oct, 2013 1 commit
-
-
This cleans up some additional issues. The main change is that on a filesystem that doesn't support mode bits, libgit2 will now create new blobs with GIT_FILEMODE_BLOB always instead of being at the mercy to the filesystem driver to report executable or not. This means that if "core.filemode" lies and claims that filemode is not supported, then we will ignore the executable bit from the filesystem. Previously we would have allowed it. This adds an option to the new git_repository_reset_filesystem to recurse through submodules if desired. There may be other types of APIs that would like a "recurse submodules" option, but this one is particularly useful. This also has a number of cleanups, etc., for related things including trying to give better error messages when problems come up from the filesystem. For example, the FAT filesystem driver on MacOS appears to return errno EINVAL if you attempt to write a filename with invalid UTF-8 in it. We try to capture that with a better error message now.
Russell Belfer committed
-
- 17 Sep, 2013 1 commit
-
-
Unfortunately git-core uses the term "unborn branch" and "orphan branch" interchangeably. However, "orphan" is only really there for the checkout command, which has the `--orphan` option so it doesn't actually create the branch. Branches never have parents, so the distinction of a branch with no parents is odd to begin with. Crucially, the error messages deal with unborn branches, so let's use that.
Carlos Martín Nieto committed
-
- 28 Jun, 2013 1 commit
-
-
In both of these cases, the submodule data should still be loaded just (obviously) without the data that comes from either the index or the HEAD. This fixes a bug in the orphaned head case.
Russell Belfer committed
-
- 19 Mar, 2013 1 commit
-
-
1. Fix sort order problem with submodules where "mod" was sorting after "mod-plus" because they were being sorted as "mod/" and "mod-plus/". This involved pushing the "contains a .git entry" test significantly lower in the stack. 2. Reinstate behavior that a directory which contains a .git entry will be treated as a submodule during iteration even if it is not yet added to the .gitmodules. 3. Now that any directory containing .git is reported as submodule, we have to be more careful checking for GIT_EEXISTS when we do a submodule lookup, because that is the error code that is returned by git_submodule_lookup when you try to look up a directory containing .git that has no record in gitmodules or the index.
Russell Belfer committed
-
- 27 Nov, 2012 1 commit
-
-
Russell Belfer committed
-
- 05 Sep, 2012 1 commit
-
-
This should confirm that issue #835 is fixed where a submodule that is only declared in the .gitmodules file was not accessible via the submodule APIs.
Russell Belfer committed
-
- 24 Aug, 2012 1 commit
-
-
This replaces the old submodule API with a new extended API that supports most of the things that can be done with `git submodule`.
Russell Belfer committed
-