Skip to content

Commit 41983db

Browse files
committed
GitRepo::fetch(): Ignore $GIT_DIR
Fixes #12325.
1 parent bd10b85 commit 41983db

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/libfetchers/git-utils.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this<GitRepoImpl>
545545
// then use code that was removed in this commit (see blame)
546546

547547
auto dir = this->path;
548-
Strings gitArgs{"-C", dir.string(), "fetch", "--quiet", "--force"};
548+
Strings gitArgs{"-C", dir.string(), "--git-dir", ".", "fetch", "--quiet", "--force"};
549549
if (shallow)
550550
append(gitArgs, {"--depth", "1"});
551551
append(gitArgs, {std::string("--"), url, refspec});

tests/functional/common/vars.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ unset XDG_DATA_HOME
6060
unset XDG_CONFIG_HOME
6161
unset XDG_CONFIG_DIRS
6262
unset XDG_CACHE_HOME
63+
unset GIT_DIR
6364

6465
export IMPURE_VAR1=foo
6566
export IMPURE_VAR2=bar

0 commit comments

Comments
 (0)