summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-09-17 22:58:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-09-17 22:58:49 (GMT)
commit26f4f2c74e2632b708ba3dd4ae2e69d359878ccd (patch)
treebe405642853c19aad329f0dc0de4c623ab425bc7 /t
parent9e40b6e59573dfd58746f9b1aafd5305ffe3c53f (diff)
parent65119878548f869270fbc8d382f042cca3a6ad05 (diff)
downloadgit-26f4f2c74e2632b708ba3dd4ae2e69d359878ccd.zip
git-26f4f2c74e2632b708ba3dd4ae2e69d359878ccd.tar.gz
git-26f4f2c74e2632b708ba3dd4ae2e69d359878ccd.tar.bz2
Merge branch 'mh/fetch-filter-refs'
Code simplification and clarification. * mh/fetch-filter-refs: test-string-list.c: Fix some sparse warnings fetch-pack: eliminate spurious error messages cmd_fetch_pack(): simplify computation of return value fetch-pack: report missing refs even if no existing refs were received cmd_fetch_pack(): return early if finish_connect() fails filter_refs(): simplify logic filter_refs(): build refs list as we go filter_refs(): delete matched refs from sought list fetch_pack(): update sought->nr to reflect number of unique entries filter_refs(): do not check the same sought_pos twice Change fetch_pack() and friends to take string_list arguments fetch_pack(): reindent function decl and defn Rename static function fetch_pack() to http_fetch_pack() t5500: add tests of fetch-pack --all --depth=N $URL $REF t5500: add tests of error output for missing refs
Diffstat (limited to 't')
-rwxr-xr-xt/t5500-fetch-pack.sh47
1 files changed, 46 insertions, 1 deletions
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index e80a2af..6322e8a 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -391,10 +391,55 @@ test_expect_success 'fetch mixed refs from cmdline and stdin' '
test_expect_success 'test duplicate refs from stdin' '
(
cd client &&
- test_must_fail git fetch-pack --stdin --no-progress .. <../input.dup
+ git fetch-pack --stdin --no-progress .. <../input.dup
) >output &&
cut -d " " -f 2 <output | sort >actual &&
test_cmp expect actual
'
+test_expect_success 'set up tests of missing reference' '
+ cat >expect-error <<-\EOF
+ error: no such remote ref refs/heads/xyzzy
+ EOF
+'
+
+test_expect_success 'test lonely missing ref' '
+ (
+ cd client &&
+ test_must_fail git fetch-pack --no-progress .. refs/heads/xyzzy
+ ) >/dev/null 2>error-m &&
+ test_cmp expect-error error-m
+'
+
+test_expect_success 'test missing ref after existing' '
+ (
+ cd client &&
+ test_must_fail git fetch-pack --no-progress .. refs/heads/A refs/heads/xyzzy
+ ) >/dev/null 2>error-em &&
+ test_cmp expect-error error-em
+'
+
+test_expect_success 'test missing ref before existing' '
+ (
+ cd client &&
+ test_must_fail git fetch-pack --no-progress .. refs/heads/xyzzy refs/heads/A
+ ) >/dev/null 2>error-me &&
+ test_cmp expect-error error-me
+'
+
+test_expect_success 'test --all, --depth, and explicit head' '
+ (
+ cd client &&
+ git fetch-pack --no-progress --all --depth=1 .. refs/heads/A
+ ) >out-adh 2>error-adh
+'
+
+test_expect_success 'test --all, --depth, and explicit tag' '
+ git tag OLDTAG refs/heads/B~5 &&
+ (
+ cd client &&
+ git fetch-pack --no-progress --all --depth=1 .. refs/tags/OLDTAG
+ ) >out-adt 2>error-adt
+'
+
test_done