Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-08submodule--helper: move "config" to a test-toolÆvar Arnfjörð Bjarmason
As with other moves to "test-tool" in f322e9f51b5 (Merge branch 'ab/submodule-helper-prep', 2022-09-13) the "config" sub-command was only used by our own tests. It was last used by "git submodule" itself in code that went away with a6226fd772b (submodule--helper: convert the bulk of cmd_add() to C, 2021-08-10). Let's move it over, and while doing so make it easier to reason about by splitting up the various uses for it into separate sub-commands, so that we don't need to count arguments to see what it does. This also has the advantage that we stop wasting future translator time on this command, currently the usage information for this internal-only tool has been translated into several languages. The use of the "_" function has also been removed from the "please make sure..." message. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>
2022-10-07Sync with 2.37.4Taylor Blau
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2022-10-07Sync with 2.33.5Taylor Blau
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2022-10-01t/t7NNN: allow local submodulesTaylor Blau
To prepare for the default value of `protocol.file.allow` to change to "user", ensure tests that rely on local submodules can initialize them over the file protocol. Tests that only need to interact with submodules in a limited capacity have individual Git commands annotated with the appropriate configuration via `-c`. Tests that interact with submodules a handful of times use `test_config_global` instead. Test scripts that rely on submodules throughout use a `git config --global` during a setup test towards the beginning of the script. Signed-off-by: Taylor Blau <me@ttaylorr.com>
2022-06-06tests: don't assume a .git/info for .git/info/sparse-checkoutÆvar Arnfjörð Bjarmason
Change those tests that assumed that a .git/info directory would be created for them when writing .git/info/sparse-checkout to explicitly create the directory by setting "TEST_CREATE_REPO_NO_TEMPLATE=1" before sourcing test-lib.sh, and using the "--template=" argument to "git clone". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-10-09submodule: pass repo to check_has_commit()Jonathan Tan
Pass the repo explicitly when calling check_has_commit() to avoid relying on add_submodule_odb(). With this commit and the parent commit, the last remaining tests no longer rely on add_submodule_odb(), so mark these tests accordingly. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-31submodule: support reading .gitmodules when it's not in the working treeAntonio Ospite
When the .gitmodules file is not available in the working tree, try using the content from the index and from the current branch. This covers the case when the file is part of the repository but for some reason it is not checked out, for example because of a sparse checkout. This makes it possible to use at least the 'git submodule' commands which *read* the gitmodules configuration file without fully populating the working tree. Writing to .gitmodules will still require that the file is checked out, so check for that before calling config_set_in_gitmodules_file_gently. Add a similar check also in git-submodule.sh::cmd_add() to anticipate the eventual failure of the "git submodule add" command when .gitmodules is not safely writeable; this prevents the command from leaving the repository in a spurious state (e.g. the submodule repository was cloned but .gitmodules was not updated because config_set_in_gitmodules_file_gently failed). Moreover, since config_from_gitmodules() now accesses the global object store, it is necessary to protect all code paths which call the function against concurrent access to the global object store. Currently this only happens in builtin/grep.c::grep_submodules(), so call grep_read_lock() before invoking code involving config_from_gitmodules(). Finally, add t7418-submodule-sparse-gitmodules.sh to verify that reading from .gitmodules succeeds and that writing to it fails when the file is not checked out. NOTE: there is one rare case where this new feature does not work properly yet: nested submodules without .gitmodules in their working tree. This has been documented with a warning and a test_expect_failure item in t7814, and in this case the current behavior is not altered: no config is read. Signed-off-by: Antonio Ospite <ao2@ao2.it> Signed-off-by: Junio C Hamano <gitster@pobox.com>