Skip to content

Commit cdc3727

Browse files
pcloudsgitster
authored andcommitted
t5500, t5539: tests for shallow depth excluding a ref
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 859e5df commit cdc3727

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

t/t5500-fetch-pack.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,4 +661,25 @@ test_expect_success 'fetch shallow since ...' '
661661
test_cmp expected actual
662662
'
663663

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+
664685
test_done

t/t5539-fetch-http-shallow.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,27 @@ test_expect_success 'fetch shallow since ...' '
9898
test_cmp expected actual
9999
'
100100

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+
101123
stop_httpd
102124
test_done

0 commit comments

Comments
 (0)