Skip to content

Commit 0f024af

Browse files
committed
Merge branch 'tr/maint-git-repack-tmpfile' into maint
* tr/maint-git-repack-tmpfile: repack: place temporary packs under .git/objects/pack/
2 parents 9bdef78 + e32dfec commit 0f024af

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

git-repack.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ true)
5252
esac
5353

5454
PACKDIR="$GIT_OBJECT_DIRECTORY/pack"
55-
PACKTMP="$GIT_OBJECT_DIRECTORY/.tmp-$$-pack"
55+
PACKTMP="$PACKDIR/.tmp-$$-pack"
5656
rm -f "$PACKTMP"-*
5757
trap 'rm -f "$PACKTMP"-*' 0 1 2 3 15
5858

@@ -82,6 +82,8 @@ case ",$all_into_one," in
8282
;;
8383
esac
8484

85+
mkdir -p "$PACKDIR" || exit
86+
8587
args="$args $local ${GIT_QUIET:+-q} $no_reuse$extra"
8688
names=$(git pack-objects --keep-true-parents --honor-pack-keep --non-empty --all --reflog $args </dev/null "$PACKTMP") ||
8789
exit 1
@@ -90,7 +92,6 @@ if [ -z "$names" ]; then
9092
fi
9193

9294
# Ok we have prepared all new packfiles.
93-
mkdir -p "$PACKDIR" || exit
9495

9596
# First see if there are packs of the same name and if so
9697
# if we can move them out of the way (this can happen if we

0 commit comments

Comments
 (0)