aboutsummaryrefslogtreecommitdiff
path: root/git-repack.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-11-24 12:47:10 -0800
committerJunio C Hamano <gitster@pobox.com>2010-11-24 12:47:10 -0800
commit0f024aff67e6c97d0a4c797181bdd0e56724c237 (patch)
tree8f8202a4541983fc67f5ddfdb38510314324bbba /git-repack.sh
parent9bdef78fb05ce2ca7788518e17ae20488b153335 (diff)
parente32dfec79f99738df3c2ffca8a9b2257c9b681fb (diff)
downloadgit-0f024aff67e6c97d0a4c797181bdd0e56724c237.tar.gz
git-0f024aff67e6c97d0a4c797181bdd0e56724c237.tar.xz
Merge branch 'tr/maint-git-repack-tmpfile' into maint
* tr/maint-git-repack-tmpfile: repack: place temporary packs under .git/objects/pack/
Diffstat (limited to 'git-repack.sh')
-rwxr-xr-xgit-repack.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-repack.sh b/git-repack.sh
index 769baaf7e..624feec26 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -52,7 +52,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
@@ -82,6 +82,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 </dev/null "$PACKTMP") ||
exit 1
@@ -90,7 +92,6 @@ if [ -z "$names" ]; then
fi
# Ok we have prepared all new packfiles.
-mkdir -p "$PACKDIR" || exit
# First see if there are packs of the same name and if so
# if we can move them out of the way (this can happen if we