diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-03 22:51:53 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-09-03 22:13:08 -0700 |
commit | 2e3400c0521e4997601916790b8b2a9ff588c6f3 (patch) | |
tree | 90d2b95d7d3830f68b63b4b418ec5a6f67e39b6f /t/t6050-replace.sh | |
parent | ad336054068074ed614d0bb54bb169e5263499d7 (diff) | |
download | git-2e3400c0521e4997601916790b8b2a9ff588c6f3.tar.gz |
parse_object: pass on the original sha1, not the replaced one
Commit 0e87c36 (object: call "check_sha1_signature" with the
replacement sha1) changed the first argument passed to
parse_object_buffer() from "sha1" to "repl". With that change,
the returned obj pointer has the replacement SHA1 in obj->sha1,
not the original one.
But when using lookup_commit() and then parse_commit() on a
commit, we get an object pointer with the original sha1, but
the commit content comes from the replacement commit.
So the result we get from using parse_object() is different
from the we get from using lookup_commit() followed by
parse_commit().
It looks much simpler and safer to fix this inconsistency by
passing "sha1" to parse_object_bufer() instead of "repl".
The commit comment should be used to tell the the replacement
commit is replacing another commit and why. So it should be
easy to see that we have a replacement commit instead of an
original one.
And it is not a problem if the content of the commit is not
consistent with the sha1 as cat-file piped to hash-object can
be used to see the difference.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6050-replace.sh')
-rwxr-xr-x | t/t6050-replace.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh index 203ffdb17a..903ebc53d7 100755 --- a/t/t6050-replace.sh +++ b/t/t6050-replace.sh @@ -209,7 +209,7 @@ test_expect_success 'fetch branch with replacement' ' test_expect_success 'bisect and replacements' ' git bisect start $HASH7 $HASH1 && - test "$S" = "$(git rev-parse --verify HEAD)" && + test "$PARA3" = "$(git rev-parse --verify HEAD)" && git bisect reset && GIT_NO_REPLACE_OBJECTS=1 git bisect start $HASH7 $HASH1 && test "$HASH4" = "$(git rev-parse --verify HEAD)" && |