summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-07-06 13:06:37 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-07-06 13:06:37 -0700
commit79498375208946f9f1fd444bdfa6abb5bb6eec40 (patch)
tree33147bf1e50db3f0308b0dd9b38034143b2b45e2 /t
parentMerge branch 'dn/gpg-doc' into maint (diff)
parentreflog: continue walking the reflog past root commits (diff)
downloadtgif-79498375208946f9f1fd444bdfa6abb5bb6eec40.tar.xz
Merge branch 'sg/reflog-past-root' into maint
"git reflog" stopped upon seeing an entry that denotes a branch creation event (aka "unborn"), which made it appear as if the reflog was truncated. * sg/reflog-past-root: reflog: continue walking the reflog past root commits
Diffstat (limited to 't')
-rwxr-xr-xt/t1401-symbolic-ref.sh2
-rwxr-xr-xt/t1410-reflog.sh22
2 files changed, 23 insertions, 1 deletions
diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh
index 417eecc3af..ca3fa406c3 100755
--- a/t/t1401-symbolic-ref.sh
+++ b/t/t1401-symbolic-ref.sh
@@ -110,7 +110,7 @@ test_expect_success 'symbolic-ref writes reflog entry' '
update
create
EOF
- git log --format=%gs -g >actual &&
+ git log --format=%gs -g -2 >actual &&
test_cmp expect actual
'
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index 9cf91dc6d2..dd2be049ec 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -348,4 +348,26 @@ test_expect_success 'reflog expire operates on symref not referrent' '
git reflog expire --expire=all the_symref
'
+test_expect_success 'continue walking past root commits' '
+ git init orphanage &&
+ (
+ cd orphanage &&
+ cat >expect <<-\EOF &&
+ HEAD@{0} commit (initial): orphan2-1
+ HEAD@{1} commit: orphan1-2
+ HEAD@{2} commit (initial): orphan1-1
+ HEAD@{3} commit (initial): initial
+ EOF
+ test_commit initial &&
+ git reflog &&
+ git checkout --orphan orphan1 &&
+ test_commit orphan1-1 &&
+ test_commit orphan1-2 &&
+ git checkout --orphan orphan2 &&
+ test_commit orphan2-1 &&
+ git log -g --format="%gd %gs" >actual &&
+ test_cmp expect actual
+ )
+'
+
test_done