summaryrefslogtreecommitdiff
path: root/t/t3404-rebase-interactive.sh
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2015-01-22 13:50:15 +0200
committerJunio C Hamano <gitster@pobox.com>2015-01-22 12:19:47 -0800
commitedb72d551128f798f5f43292789cb7c731d1e01f (patch)
treec0f7a8a824e4bfbeefd230b3edc2d8f033a41451 /t/t3404-rebase-interactive.sh
parent3c84ac86fc896c108b789b8eb26b169cc0e8088a (diff)
downloadgit-edb72d551128f798f5f43292789cb7c731d1e01f.tar.gz
rebase -i: use full object name internally throughout the scriptks/rebase-i-abbrev
In earlier days, the abbreviated commit object name shown to the end users were generated with hardcoded --abbrev=7; 56895038 (rebase -i: respect core.abbrev, 2013-09-28) tried to make it honor the user specified core.abbrev, but it missed the very initial invocation of the editor. These days, we try to use the full 40-hex object names internally to avoid ambiguity that can arise after rebase starts running. Newly created objects during the rebase may share the same prefix with existing commits listed in the insn sheet. These object names are shortened just before invoking the sequence editor to present the insn sheet to the end user, and then expanded back to full object names when the editor returns. But the code still used the shortened names when preparing the insn sheet for the very first time, resulting "7 hexdigits or more" output to the user. Change the code to use full 40-hex commit object names from the very beginning to make things more uniform. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3404-rebase-interactive.sh')
-rwxr-xr-xt/t3404-rebase-interactive.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 8197ed29a9..a31f7e0430 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -1039,4 +1039,11 @@ test_expect_success 'short SHA-1 collide' '
)
'
+test_expect_success 'respect core.abbrev' '
+ git config core.abbrev 12 &&
+ set_cat_todo_editor &&
+ test_must_fail git rebase -i HEAD~4 >todo-list &&
+ test 4 = $(grep -c "pick [0-9a-f]\{12,\}" todo-list)
+'
+
test_done