t5500, t5539: tests for shallow depth excluding a ref
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sun, 12 Jun 2016 10:54:06 +0000 (17:54 +0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Jun 2016 21:38:16 +0000 (14:38 -0700)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5500-fetch-pack.sh
t/t5539-fetch-http-shallow.sh
index 26f050d15c79f5edeb5962f945dd28ebc5a60eb4..145b3707685c1751d0a161c73c077dfe6dad01fc 100755 (executable)
@@ -661,4 +661,25 @@ test_expect_success 'fetch shallow since ...' '
        test_cmp expected actual
 '
 
+test_expect_success 'shallow clone exclude tag two' '
+       test_create_repo shallow-exclude &&
+       (
+       cd shallow-exclude &&
+       test_commit one &&
+       test_commit two &&
+       test_commit three &&
+       git clone --shallow-exclude two "file://$(pwd)/." ../shallow12 &&
+       git -C ../shallow12 log --pretty=tformat:%s HEAD >actual &&
+       echo three >expected &&
+       test_cmp expected actual
+       )
+'
+
+test_expect_success 'fetch exclude tag one' '
+       git -C shallow12 fetch --shallow-exclude one origin &&
+       git -C shallow12 log --pretty=tformat:%s origin/master >actual &&
+       test_write_lines three two >expected &&
+       test_cmp expected actual
+'
+
 test_done
index 704753c8422dfc99a7ef5577a372f4197d29ea21..8e38c1be659fd7d19ca758042ab5683df91d983e 100755 (executable)
@@ -98,5 +98,27 @@ test_expect_success 'fetch shallow since ...' '
        test_cmp expected actual
 '
 
+test_expect_success 'shallow clone exclude tag two' '
+       test_create_repo shallow-exclude &&
+       (
+       cd shallow-exclude &&
+       test_commit one &&
+       test_commit two &&
+       test_commit three &&
+       mv .git "$HTTPD_DOCUMENT_ROOT_PATH/shallow-exclude.git" &&
+       git clone --shallow-exclude two $HTTPD_URL/smart/shallow-exclude.git ../shallow12 &&
+       git -C ../shallow12 log --pretty=tformat:%s HEAD >actual &&
+       echo three >expected &&
+       test_cmp expected actual
+       )
+'
+
+test_expect_success 'fetch exclude tag one' '
+       git -C shallow12 fetch --shallow-exclude one origin &&
+       git -C shallow12 log --pretty=tformat:%s origin/master >actual &&
+       test_write_lines three two >expected &&
+       test_cmp expected actual
+'
+
 stop_httpd
 test_done