Skip to content

Commit dd71836

Browse files
drafnelgitster
authored andcommitted
repack: don't repack local objects in packs with .keep file
If the user created a .keep file for a local pack, then it can be inferred that the user does not want those objects repacked. This fixes the repack bug tested by t7700. Signed-off-by: Brandon Casey <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e96fb9b commit dd71836

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

git-repack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ case ",$all_into_one," in
8383
esac
8484

8585
args="$args $local $quiet $no_reuse$extra"
86-
names=$(git pack-objects --non-empty --all --reflog $args </dev/null "$PACKTMP") ||
86+
names=$(git pack-objects --honor-pack-keep --non-empty --all --reflog $args </dev/null "$PACKTMP") ||
8787
exit 1
8888
if [ -z "$names" ]; then
8989
if test -z "$quiet"; then

t/t7700-repack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ test_description='git repack works correctly'
44

55
. ./test-lib.sh
66

7-
test_expect_failure 'objects in packs marked .keep are not repacked' '
7+
test_expect_success 'objects in packs marked .keep are not repacked' '
88
echo content1 > file1 &&
99
echo content2 > file2 &&
1010
git add . &&

0 commit comments

Comments
 (0)