From e32dfec79f99738df3c2ffca8a9b2257c9b681fb Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Tue, 19 Oct 2010 11:50:43 +0200 Subject: [PATCH] repack: place temporary packs under .git/objects/pack/ git-pack-objects is already careful to start out its temporary packs under .git/objects/pack/ (cf. 8b4eb6b, Do not perform cross-directory renames when creating packs, 2008-09-22), but git-repack did not respond in kind so the effort was lost when the filesystem boundary is exactly at that directory. Let git-repack pass a path under .git/objects/pack/ as the base for its temporary packs. This means we might need the $PACKDIR sooner (before the pack-objects invocation), so move the mkdir up just to be safe. Also note that the only use of *.pack is in the find invocation way before the pack-objects call, so the temporary packs will not suddenly show up in any wildcards because of the directory change. Reported-by: Marat Radchenko Signed-off-by: Thomas Rast Signed-off-by: Junio C Hamano --- git-repack.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/git-repack.sh b/git-repack.sh index 1eb3bca35..d21b274de 100755 --- a/git-repack.sh +++ b/git-repack.sh @@ -50,7 +50,7 @@ true) esac PACKDIR="$GIT_OBJECT_DIRECTORY/pack" -PACKTMP="$GIT_OBJECT_DIRECTORY/.tmp-$$-pack" +PACKTMP="$PACKDIR/.tmp-$$-pack" rm -f "$PACKTMP"-* trap 'rm -f "$PACKTMP"-*' 0 1 2 3 15 @@ -80,6 +80,8 @@ case ",$all_into_one," in ;; esac +mkdir -p "$PACKDIR" || exit + args="$args $local ${GIT_QUIET:+-q} $no_reuse$extra" names=$(git pack-objects --keep-true-parents --honor-pack-keep --non-empty --all --reflog $args