Skip to content

Commit

Permalink
repack: don't repack local objects in packs with .keep file
Browse files Browse the repository at this point in the history
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 <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Brandon Casey authored and Junio C Hamano committed Nov 12, 2008
1 parent e96fb9b commit dd71836
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion git-repack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ case ",$all_into_one," in
esac

args="$args $local $quiet $no_reuse$extra"
names=$(git pack-objects --non-empty --all --reflog $args </dev/null "$PACKTMP") ||
names=$(git pack-objects --honor-pack-keep --non-empty --all --reflog $args </dev/null "$PACKTMP") ||
exit 1
if [ -z "$names" ]; then
if test -z "$quiet"; then
Expand Down
2 changes: 1 addition & 1 deletion t/t7700-repack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ test_description='git repack works correctly'

. ./test-lib.sh

test_expect_failure 'objects in packs marked .keep are not repacked' '
test_expect_success 'objects in packs marked .keep are not repacked' '
echo content1 > file1 &&
echo content2 > file2 &&
git add . &&
Expand Down

0 comments on commit dd71836

Please sign in to comment.