summaryrefslogtreecommitdiff
path: root/t/t1410-reflog.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-11-06 10:52:31 -0800
committerJunio C Hamano <gitster@pobox.com>2014-11-06 10:52:32 -0800
commita1671dd82b5e1c6e837a3f47509a3a33189b0884 (patch)
tree7481de8581bc9b94b6059333009e4c155a75dd99 /t/t1410-reflog.sh
parent6b55f8b54601c6e6319566875b104d333930bc76 (diff)
parent9233887cce8eaebd8469315622b84bd26910351f (diff)
downloadgit-a1671dd82b5e1c6e837a3f47509a3a33189b0884.tar.gz
Merge branch 'jk/fetch-reflog-df-conflict'
Corner-case bugfixes for "git fetch" around reflog handling. * jk/fetch-reflog-df-conflict: ignore stale directories when checking reflog existence fetch: load all default config at startup
Diffstat (limited to 't/t1410-reflog.sh')
-rwxr-xr-xt/t1410-reflog.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index 8cab06f90a..976c1d4277 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -253,4 +253,38 @@ test_expect_success 'checkout should not delete log for packed ref' '
test $(git reflog master | wc -l) = 4
'
+test_expect_success 'stale dirs do not cause d/f conflicts (reflogs on)' '
+ test_when_finished "git branch -d a || git branch -d a/b" &&
+
+ git branch a/b master &&
+ echo "a/b@{0} branch: Created from master" >expect &&
+ git log -g --format="%gd %gs" a/b >actual &&
+ test_cmp expect actual &&
+ git branch -d a/b &&
+
+ # now logs/refs/heads/a is a stale directory, but
+ # we should move it out of the way to create "a" reflog
+ git branch a master &&
+ echo "a@{0} branch: Created from master" >expect &&
+ git log -g --format="%gd %gs" a >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'stale dirs do not cause d/f conflicts (reflogs off)' '
+ test_when_finished "git branch -d a || git branch -d a/b" &&
+
+ git branch a/b master &&
+ echo "a/b@{0} branch: Created from master" >expect &&
+ git log -g --format="%gd %gs" a/b >actual &&
+ test_cmp expect actual &&
+ git branch -d a/b &&
+
+ # same as before, but we only create a reflog for "a" if
+ # it already exists, which it does not
+ git -c core.logallrefupdates=false branch a master &&
+ : >expect &&
+ git log -g --format="%gd %gs" a >actual &&
+ test_cmp expect actual
+'
+
test_done