diff options
Diffstat (limited to 'git-prune-script')
-rwxr-xr-x | git-prune-script | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/git-prune-script b/git-prune-script index 9ba89a5b9..c0ffb1dcb 100755 --- a/git-prune-script +++ b/git-prune-script @@ -28,9 +28,13 @@ sed -ne '/unreachable /{ s/unreachable [^ ][^ ]* // s|\(..\)|\1/|p }' | { - case "$SHA1_FILE_DIRECTORY" in + for d in "$GIT_OBJECT_DIRECTORY" "$SHA1_FILE_DIRECTORY" '' + do + test "$d" != "" && test -d "$d" && break + done + case "$d" in '') cd .git/objects/ ;; - *) cd "$SHA1_FILE_DIRECTORY" ;; + *) cd "$d" ;; esac || exit xargs -r $dryrun rm -f } |