Skip to content

Commit

Permalink
git-repack.sh: don't use --kept-pack-only option to pack-objects
Browse files Browse the repository at this point in the history
The --kept-pack-only option to pack-objects treats all kept packs as equal.
This results in objects that reside in an alternate pack that has a .keep
file, not being packed into a newly created pack when the user specifies the
-a option to repack.  Since the user may not have any control over the
alternate database, git should not refrain from repacking those objects
even though they are in a pack with a .keep file.

This fixes the 'packed obs in alternate ODB kept pack are repacked' test in
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 Mar 20, 2009
1 parent 92cd872 commit 171110a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions git-repack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ case ",$all_into_one," in
existing="$existing $e"
fi
done
if test -n "$existing"
then
args="--kept-pack-only"
fi
if test -n "$args" -a -n "$unpack_unreachable" -a \
if test -n "$existing" -a -n "$unpack_unreachable" -a \
-n "$remove_redundant"
then
args="$args $unpack_unreachable"
Expand Down
2 changes: 1 addition & 1 deletion t/t7700-repack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ test_expect_success 'packed obs in alt ODB are repacked even when local repo is
done
'

test_expect_failure 'packed obs in alternate ODB kept pack are repacked' '
test_expect_success 'packed obs in alternate ODB kept pack are repacked' '
# swap the .keep so the commit object is in the pack with .keep
for p in alt_objects/pack/*.pack
do
Expand Down

0 comments on commit 171110a

Please sign in to comment.