summaryrefslogtreecommitdiff
path: root/t/t3404-rebase-interactive.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2020-01-23 12:28:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-01-23 20:48:12 (GMT)
commit26027625dd1ee358e2174a09d519252995d51662 (patch)
tree7f511fa73740ccf71e0c431e017454cba884c058 /t/t3404-rebase-interactive.sh
parentb6992261deb1c32e11998b19467ecd4d328ba049 (diff)
downloadgit-26027625dd1ee358e2174a09d519252995d51662.zip
git-26027625dd1ee358e2174a09d519252995d51662.tar.gz
git-26027625dd1ee358e2174a09d519252995d51662.tar.bz2
rebase -i: also avoid SHA-1 collisions with missingCommitsCheck
When `rebase.missingCommitsCheck` is in effect, we use the backup of the todo list that was copied just before the user was allowed to edit it. That backup is, of course, just as susceptible to the hash collision as the todo list itself: a reworded commit could make a previously unambiguous short commit ID ambiguous all of a sudden. So let's not just copy the todo list, but let's instead write out the backup with expanded commit IDs. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3404-rebase-interactive.sh')
-rwxr-xr-xt/t3404-rebase-interactive.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 1cc9f36..b90ea0f 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -1277,6 +1277,8 @@ test_expect_success SHA1 'short SHA-1 collide' '
.git/rebase-merge/git-rebase-todo.tmp &&
grep "^pick [0-9a-f]\{40\}" \
.git/rebase-merge/git-rebase-todo &&
+ grep "^pick [0-9a-f]\{40\}" \
+ .git/rebase-merge/git-rebase-todo.backup &&
git rebase --continue
) &&
collide2="$(git rev-parse HEAD~1 | cut -c 1-4)" &&