1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00

GitRepo::fetch(): Ignore $GIT_DIR

Fixes #12325.
This commit is contained in:
Eelco Dolstra 2025-01-22 17:54:19 +01:00
parent bd10b859f7
commit 41983dba8f
2 changed files with 2 additions and 1 deletions

View file

@ -545,7 +545,7 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this<GitRepoImpl>
// then use code that was removed in this commit (see blame)
auto dir = this->path;
Strings gitArgs{"-C", dir.string(), "fetch", "--quiet", "--force"};
Strings gitArgs{"-C", dir.string(), "--git-dir", ".", "fetch", "--quiet", "--force"};
if (shallow)
append(gitArgs, {"--depth", "1"});
append(gitArgs, {std::string("--"), url, refspec});

View file

@ -60,6 +60,7 @@ unset XDG_DATA_HOME
unset XDG_CONFIG_HOME
unset XDG_CONFIG_DIRS
unset XDG_CACHE_HOME
unset GIT_DIR
export IMPURE_VAR1=foo
export IMPURE_VAR2=bar