Skip to content

Commit 171110a

Browse files
drafnelgitster
authored andcommitted
git-repack.sh: don't use --kept-pack-only option to pack-objects
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 92cd872 commit 171110a

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

git-repack.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,7 @@ case ",$all_into_one," in
7171
existing="$existing $e"
7272
fi
7373
done
74-
if test -n "$existing"
75-
then
76-
args="--kept-pack-only"
77-
fi
78-
if test -n "$args" -a -n "$unpack_unreachable" -a \
74+
if test -n "$existing" -a -n "$unpack_unreachable" -a \
7975
-n "$remove_redundant"
8076
then
8177
args="$args $unpack_unreachable"

t/t7700-repack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ test_expect_success 'packed obs in alt ODB are repacked even when local repo is
6969
done
7070
'
7171

72-
test_expect_failure 'packed obs in alternate ODB kept pack are repacked' '
72+
test_expect_success 'packed obs in alternate ODB kept pack are repacked' '
7373
# swap the .keep so the commit object is in the pack with .keep
7474
for p in alt_objects/pack/*.pack
7575
do

0 commit comments

Comments
 (0)