1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

GitRepo::fetch(): Ignore $GIT_DIR

Fixes #12325.

(cherry picked from commit 41983dba8f)
This commit is contained in:
Eelco Dolstra 2025-01-22 17:54:19 +01:00
parent 4511c47ab7
commit 1a402db046

View file

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