builtin/checkout: compute checkout metadata for checkouts
Provide commit metadata for checkout code paths that use unpack_trees
and friends. When we're checking out a commit, use the commit
information, but don't provide commit information if we're checking out
from the index, since there need not be any particular commit associated
with the index, and even if there is one, we can't know what it is.
Signed-off-by: brian m. carlson <bk2204@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
brian m. carlson5 years agocommitted byJunio C Hamano
@ -519,17 +524,22 @@ test_expect_success PERL 'required process filter should process multiple packet
@@ -519,17 +524,22 @@ test_expect_success PERL 'required process filter should process multiple packet
@ -578,6 +588,10 @@ test_expect_success PERL 'process filter should restart after unexpected write f
@@ -578,6 +588,10 @@ test_expect_success PERL 'process filter should restart after unexpected write f
S=$(file_size test.r) &&
S2=$(file_size test2.r) &&
SF=$(file_size smudge-write-fail.r) &&
M=$(git hash-object test.r) &&
M2=$(git hash-object test2.r) &&
MF=$(git hash-object smudge-write-fail.r) &&
rm -f debug.log &&
git add . &&
rm -f *.r &&
@ -591,11 +605,11 @@ test_expect_success PERL 'process filter should restart after unexpected write f
@@ -591,11 +605,11 @@ test_expect_success PERL 'process filter should restart after unexpected write f
@ -629,6 +643,10 @@ test_expect_success PERL 'process filter should not be restarted if it signals a
@@ -629,6 +643,10 @@ test_expect_success PERL 'process filter should not be restarted if it signals a
S=$(file_size test.r) &&
S2=$(file_size test2.r) &&
SE=$(file_size error.r) &&
M=$(git hash-object test.r) &&
M2=$(git hash-object test2.r) &&
ME=$(git hash-object error.r) &&
rm -f debug.log &&
git add . &&
rm -f *.r &&
@ -637,9 +655,9 @@ test_expect_success PERL 'process filter should not be restarted if it signals a
@@ -637,9 +655,9 @@ test_expect_success PERL 'process filter should not be restarted if it signals a
@ -665,18 +683,21 @@ test_expect_success PERL 'process filter abort stops processing of all further f
@@ -665,18 +683,21 @@ test_expect_success PERL 'process filter abort stops processing of all further f
echo "error this blob and all future blobs" >abort.o &&
cp abort.o abort.r &&
M="blob=$(git hash-object abort.r)" &&
rm -f debug.log &&
SA=$(file_size abort.r) &&
git add . &&
rm -f *.r &&
# Note: This test assumes that Git filters files in alphabetical
# order ("abort.r" before "test.r").
filter_git checkout --quiet --no-progress . &&
cat >expected.log <<-EOF &&
START
init handshake complete
IN: smudge abort.r $SA [OK] -- [ABORT]
IN: smudge abort.r $M $SA [OK] -- [ABORT]
STOP
EOF
test_cmp_exclude_clean expected.log debug.log &&
@ -727,27 +748,28 @@ test_expect_success PERL 'delayed checkout in process filter' '
@@ -727,27 +748,28 @@ test_expect_success PERL 'delayed checkout in process filter' '