t5500, t5539: tests for shallow depth excluding a ref
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Jun 12, 2016 at 17:54 UTC
cdc37277f904ff5c832f04db9e799bccd9672ea5
2 files changed
+43
t/t5500-fetch-pack.sh
+21
@@ -661,4 +661,25 @@ test_expect_success 'fetch shallow since ...' '
661
test_cmp expected actual
662
'
663
664
+test_expect_success 'shallow clone exclude tag two' '
665
+ test_create_repo shallow-exclude &&
666
+ (
667
+ cd shallow-exclude &&
668
+ test_commit one &&
669
+ test_commit two &&
670
+ test_commit three &&
671
+ git clone --shallow-exclude two "file://$(pwd)/." ../shallow12 &&
672
+ git -C ../shallow12 log --pretty=tformat:%s HEAD >actual &&
673
+ echo three >expected &&
674
+ test_cmp expected actual
675
+ )
676
+'
677
+
678
+test_expect_success 'fetch exclude tag one' '
679
+ git -C shallow12 fetch --shallow-exclude one origin &&
680
+ git -C shallow12 log --pretty=tformat:%s origin/master >actual &&
681
+ test_write_lines three two >expected &&
682
+ test_cmp expected actual
683
+'
684
+
685
test_done
t/t5539-fetch-http-shallow.sh
+22
@@ -98,5 +98,27 @@ test_expect_success 'fetch shallow since ...' '
98
test_cmp expected actual
99
'
100
101
+test_expect_success 'shallow clone exclude tag two' '
102
+ test_create_repo shallow-exclude &&
103
+ (
104
+ cd shallow-exclude &&
105
+ test_commit one &&
106
+ test_commit two &&
107
+ test_commit three &&
108
+ mv .git "$HTTPD_DOCUMENT_ROOT_PATH/shallow-exclude.git" &&
109
+ git clone --shallow-exclude two $HTTPD_URL/smart/shallow-exclude.git ../shallow12 &&
110
+ git -C ../shallow12 log --pretty=tformat:%s HEAD >actual &&
111
+ echo three >expected &&
112
+ test_cmp expected actual
113
+ )
114
+'
115
+
116
+test_expect_success 'fetch exclude tag one' '
117
+ git -C shallow12 fetch --shallow-exclude one origin &&
118
+ git -C shallow12 log --pretty=tformat:%s origin/master >actual &&
119
+ test_write_lines three two >expected &&
120
+ test_cmp expected actual
121
+'
122
+
123
stop_httpd
124
test_done