summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-12-22 12:28:02 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-12-22 12:28:02 -0800
commit8ada1d8e9c71eeebaf6af3adc664a17479f2c2e8 (patch)
tree3f0604c93636fdd6b2ac39bf24aa414a17f3c841 /t
parentMerge branch 'jk/colors' (diff)
parentpkt-line: allow writing of LARGE_PACKET_MAX buffers (diff)
downloadtgif-8ada1d8e9c71eeebaf6af3adc664a17479f2c2e8.tar.xz
Merge branch 'jk/always-allow-large-packets'
"git push" and "git fetch" did not communicate an overlong refname correctly. * jk/always-allow-large-packets: pkt-line: allow writing of LARGE_PACKET_MAX buffers
Diffstat (limited to 't')
-rwxr-xr-xt/t5527-fetch-odd-refs.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/t5527-fetch-odd-refs.sh b/t/t5527-fetch-odd-refs.sh
index edea9f957e..207899a99f 100755
--- a/t/t5527-fetch-odd-refs.sh
+++ b/t/t5527-fetch-odd-refs.sh
@@ -26,4 +26,37 @@ test_expect_success 'suffix ref is ignored during fetch' '
test_cmp expect actual
'
+test_expect_success 'try to create repo with absurdly long refname' '
+ ref240=$_z40/$_z40/$_z40/$_z40/$_z40/$_z40 &&
+ ref1440=$ref240/$ref240/$ref240/$ref240/$ref240/$ref240 &&
+ git init long &&
+ (
+ cd long &&
+ test_commit long &&
+ test_commit master
+ ) &&
+ if git -C long update-ref refs/heads/$ref1440 long; then
+ test_set_prereq LONG_REF
+ else
+ echo >&2 "long refs not supported"
+ fi
+'
+
+test_expect_success LONG_REF 'fetch handles extremely long refname' '
+ git fetch long refs/heads/*:refs/remotes/long/* &&
+ cat >expect <<-\EOF &&
+ long
+ master
+ EOF
+ git for-each-ref --format="%(subject)" refs/remotes/long >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success LONG_REF 'push handles extremely long refname' '
+ git push long :refs/heads/$ref1440 &&
+ git -C long for-each-ref --format="%(subject)" refs/heads >actual &&
+ echo master >expect &&
+ test_cmp expect actual
+'
+
test_done