summaryrefslogtreecommitdiff
path: root/t/t3404-rebase-interactive.sh
diff options
context:
space:
mode:
authorLibravatar Nguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-02-11 16:43:28 +0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-02-12 14:07:59 -0800
commitfbd7a23237094c3fb2e249bbcacbbf1e858e79c9 (patch)
treee6d0c78248f7bd326f68baafc894bff7cb75eb2a /t/t3404-rebase-interactive.sh
parentrebase: add --show-current-patch (diff)
downloadtgif-fbd7a23237094c3fb2e249bbcacbbf1e858e79c9.tar.xz
rebase: introduce and use pseudo-ref REBASE_HEAD
The new command `git rebase --show-current-patch` is useful for seeing the commit related to the current rebase state. Some however may find the "git show" command behind it too limiting. You may want to increase context lines, do a diff that ignores whitespaces... For these advanced use cases, the user can execute any command they want with the new pseudo ref REBASE_HEAD. This also helps show where the stopped commit is from, which is hard to see from the previous patch which implements --show-current-patch. Helped-by: Tim Landscheidt <tim@tim-landscheidt.de> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3404-rebase-interactive.sh')
-rwxr-xr-xt/t3404-rebase-interactive.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 3af6f149a9..23a54a4c49 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -227,7 +227,10 @@ test_expect_success 'stop on conflicting pick' '
test_expect_success 'show conflicted patch' '
GIT_TRACE=1 git rebase --show-current-patch >/dev/null 2>stderr &&
- grep "show.*$(cat "$state_dir/stopped-sha")" stderr
+ grep "show.*REBASE_HEAD" stderr &&
+ # the original stopped-sha1 is abbreviated
+ stopped_sha1="$(git rev-parse $(cat ".git/rebase-merge/stopped-sha"))" &&
+ test "$(git rev-parse REBASE_HEAD)" = "$stopped_sha1"
'
test_expect_success 'abort' '