summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-14 22:26:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-11-14 22:26:04 (GMT)
commitf5f6cb87defc4b7e8ba6cc6e82f616bef47ea6b0 (patch)
treecfa0daa0b019e83aba1d15ae5d8a4359da578a0e /t
parentb2e163272c01aca4aee4684f5c683ba341c1953d (diff)
parent4191c35671f6392173221bea3994f8b305f4f3a8 (diff)
downloadgit-f5f6cb87defc4b7e8ba6cc6e82f616bef47ea6b0.zip
git-f5f6cb87defc4b7e8ba6cc6e82f616bef47ea6b0.tar.gz
git-f5f6cb87defc4b7e8ba6cc6e82f616bef47ea6b0.tar.bz2
Merge branch 'sp/fetch-fix'
* sp/fetch-fix: git-fetch: avoid local fetching from alternate (again) rev-list: Introduce --quiet to avoid /dev/null redirects run-command: Support sending stderr to /dev/null git-fetch: Always fetch tags if the object they reference exists
Diffstat (limited to 't')
-rwxr-xr-xt/t5502-quickfetch.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/t5502-quickfetch.sh b/t/t5502-quickfetch.sh
index b4760f2..16eadd6 100755
--- a/t/t5502-quickfetch.sh
+++ b/t/t5502-quickfetch.sh
@@ -86,4 +86,37 @@ test_expect_success 'quickfetch should not leave a corrupted repository' '
'
+test_expect_success 'quickfetch should not copy from alternate' '
+
+ (
+ mkdir quickclone &&
+ cd quickclone &&
+ git init-db &&
+ (cd ../.git/objects && pwd) >.git/objects/info/alternates &&
+ git remote add origin .. &&
+ git fetch -k -k
+ ) &&
+ obj_cnt=$( (
+ cd quickclone &&
+ git count-objects | sed -e "s/ *objects,.*//"
+ ) ) &&
+ pck_cnt=$( (
+ cd quickclone &&
+ git count-objects -v | sed -n -e "/packs:/{
+ s/packs://
+ p
+ q
+ }"
+ ) ) &&
+ origin_master=$( (
+ cd quickclone &&
+ git rev-parse origin/master
+ ) ) &&
+ echo "loose objects: $obj_cnt, packfiles: $pck_cnt" &&
+ test $obj_cnt -eq 0 &&
+ test $pck_cnt -eq 0 &&
+ test z$origin_master = z$(git rev-parse master)
+
+'
+
test_done