]> git.ipfire.org Git - thirdparty/git.git/commit - sequencer.c
sequencer: ensure labels that are object IDs are rewritten
authorbrian m. carlson <sandals@crustytoothpaste.net>
Tue, 29 May 2018 16:32:36 +0000 (16:32 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 May 2018 04:32:16 +0000 (13:32 +0900)
commit5971b0836eece0ffcafe15fd5d67934787ea1777
treedcd12e4f818cc88061eef668cb7ce77665102785
parent35d515b53f594e9b281f15943ba1b66a2305857a
sequencer: ensure labels that are object IDs are rewritten

When writing the todo script for --rebase-merges, we try to find a label
for certain commits.  If the label ends up being a valid object ID, such
as when we merge a detached commit, we want to rewrite it so it is no
longer a valid object ID.

However, the code path that does this checks for its length to be
equivalent to GIT_SHA1_RAWSZ, which isn't correct, since what we are
reading is a hex object ID.  Instead, check for the length being
equivalent to that of a hex object ID.  Use the_hash_algo so this code
works regardless of the hash size.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
t/t3430-rebase-merges.sh