Skip to content

Commit

Permalink
GitRepo::fetch(): Ignore $GIT_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Jan 22, 2025
1 parent bd10b85 commit 41983db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/libfetchers/git-utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down
1 change: 1 addition & 0 deletions tests/functional/common/vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41983db

Please sign in to comment.