From 44c2449bef3d965ad1a093b75916f55115e4875a Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sat, 13 Aug 2016 20:45:19 -0700 Subject: [PATCH] gc.sh: use --git-dir= instead of GIT_DIR= Using GIT_DIR= has an unfortunate interaction with the git() wrapper in shlib.sh that can leave GIT_DIR set when it was supposed to be set only temporarily. Therefore switch from using GIT_DIR= to --git-dir= instead to avoid this problem. Fortunately in this case there were no ill effects because thanks to the "get_repo_list | while read" pipe the problematic GIT_DIR= was running in a subshell and could not adversely affect any other code. Signed-off-by: Kyle J. McKay --- jobd/gc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobd/gc.sh b/jobd/gc.sh index ff0b68a..a227a3a 100755 --- a/jobd/gc.sh +++ b/jobd/gc.sh @@ -527,7 +527,7 @@ if [ -d "../${forkdir##*/}" ]; then ln -f objects/pack/pack-*.idx "$cfg_reporoot/$fork.git/objects/pack" || : fi # Update the fork's lastparentgc date (must be current, not $gcstart) - GIT_DIR="$cfg_reporoot/$fork.git" git config \ + git --git-dir="$cfg_reporoot/$fork.git" config \ gitweb.lastparentgc "$(date "$datefmt")" done fi -- 2.11.4.GIT