aboutsummaryrefslogtreecommitdiff
path: root/t/t5516-fetch-push.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-08-12 20:55:55 +0700
committerJunio C Hamano <gitster@pobox.com>2013-08-13 10:32:26 -0700
commitf7c815c3eede201def87a643fdcad09a9af3e3e7 (patch)
treec06a8745426da9f131248332b0da46724fd2ae97 /t/t5516-fetch-push.sh
parent96cb27a9d2db3c01b8e296a0fbc1da1da09d1412 (diff)
downloadgit-f7c815c3eede201def87a643fdcad09a9af3e3e7.tar.gz
git-f7c815c3eede201def87a643fdcad09a9af3e3e7.tar.xz
push: respect --no-thin
- From the beginning of push.c in 755225d, 2006-04-29, "thin" option was enabled by default but could be turned off with --no-thin. - Then Shawn changed the default to 0 in favor of saving server resources in a4503a1, 2007-09-09. --no-thin worked great. - One day later, in 9b28851 Daniel extracted some code from push.c to create transport.c. He (probably accidentally) flipped the default value from 0 to 1 in transport_get(). From then on --no-thin is effectively no-op because git-push still expects the default value to be false and only calls transport_set_option() when "thin" variable in push.c is true (which is unnecessary). Correct the code to respect --no-thin by calling transport_set_option() in both cases. receive-pack learns about --reject-thin-pack-for-testing option, which only is for testing purposes, hence no document update. 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/t5516-fetch-push.sh')
-rwxr-xr-xt/t5516-fetch-push.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 4691d51b8..99c32d753 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -1172,4 +1172,21 @@ test_expect_success 'push --follow-tag only pushes relevant tags' '
test_cmp expect actual
'
+test_expect_success 'push --no-thin must produce non-thin pack' '
+ cat >>path1 <<\EOF &&
+keep base version of path1 big enough, compared to the new changes
+later, in order to pass size heuristics in
+builtin/pack-objects.c:try_delta()
+EOF
+ git commit -am initial &&
+ git init no-thin &&
+ git --git-dir=no-thin/.git config receive.unpacklimit 0 &&
+ git push no-thin/.git refs/heads/master:refs/heads/foo &&
+ echo modified >> path1 &&
+ git commit -am modified &&
+ git repack -adf &&
+ rcvpck="git receive-pack --reject-thin-pack-for-testing" &&
+ git push --no-thin --receive-pack="$rcvpck" no-thin/.git refs/heads/master:refs/heads/foo
+'
+
test_done