diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2013-11-11 13:43:52 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2013-11-11 13:43:52 +0000 |
commit | 4390a22b1d413dc565c18ca7b7dc107008d665fc (patch) | |
tree | 5874f2ca3af714b387e24611d64a147cd4dcbeed /scripts | |
parent | 7251b5b0d9b849f9748cd2342f0675eb9ce5578c (diff) |
git-cache-proxy: postpone chdir so Housekeeping lock and stamp and up in the right directory.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/git-cache-proxy | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/git-cache-proxy b/scripts/git-cache-proxy index 4d55233..d12bdb3 100755 --- a/scripts/git-cache-proxy +++ b/scripts/git-cache-proxy @@ -370,10 +370,10 @@ sub clonefetch () { servinfo "sharing"; lockfile \*LOCK, $lock, LOCK_SH; # NB releases and relocks - if (chdir $gitd) { + if (stat $gitd) { return 1; } - $!==ENOENT or fail "chdir $gitd: $!"; + $!==ENOENT or fail "stat $gitd: $!"; # Well, err, someone must have taken the lock in between # and garbage collected it. How annoying. @@ -457,6 +457,9 @@ sub housekeepingcheck ($$) { sub runcommand () { servinfo "serving"; + + chdir $gitd or fail "chdir $gitd: $!"; + exec qw(git-upload-pack --strict --timeout=1000 .) or fail "exec git-upload-pack: $!"; } |