From 4390a22b1d413dc565c18ca7b7dc107008d665fc Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 11 Nov 2013 13:43:52 +0000 Subject: [PATCH] git-cache-proxy: postpone chdir so Housekeeping lock and stamp and up in the right directory. --- debian/changelog | 7 +++++++ scripts/git-cache-proxy | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2c104e8..baf572c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +chiark-utils (4.2.1~~iwj3) unstable; urgency=low + + * git-cache-proxy: postpone chdir so Housekeeping lock and stamp + and up in the right directory. + + -- Ian Jackson Mon, 11 Nov 2013 13:43:47 +0000 + chiark-utils (4.2.1~~iwj2) unstable; urgency=low New utility: 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: $!"; } -- 2.30.2