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
This commit is contained in:
Junio C Hamano
2014-12-22 12:28:02 -08:00
2 changed files with 52 additions and 18 deletions

View File

@ -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