t5500, t5539: tests for shallow depth since a specific date
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
6d43a0cefd769c650bd114f41434ef5a7aa998e7
2 files changed
+49
t/t5500-fetch-pack.sh
+24
@@ -637,4 +637,28 @@ test_expect_success MINGW 'fetch-pack --diag-url c:repo' '
637
check_prot_path c:repo file c:repo
638
'
639
640
+test_expect_success 'clone shallow since ...' '
641
+ test_create_repo shallow-since &&
642
+ (
643
+ cd shallow-since &&
644
+ GIT_COMMITTER_DATE="100000000 +0700" git commit --allow-empty -m one &&
645
+ GIT_COMMITTER_DATE="200000000 +0700" git commit --allow-empty -m two &&
646
+ GIT_COMMITTER_DATE="300000000 +0700" git commit --allow-empty -m three &&
647
+ git clone --shallow-since "300000000 +0700" "file://$(pwd)/." ../shallow11 &&
648
+ git -C ../shallow11 log --pretty=tformat:%s HEAD >actual &&
649
+ echo three >expected &&
650
+ test_cmp expected actual
651
+ )
652
+'
653
+
654
+test_expect_success 'fetch shallow since ...' '
655
+ git -C shallow11 fetch --shallow-since "200000000 +0700" origin &&
656
+ git -C shallow11 log --pretty=tformat:%s origin/master >actual &&
657
+ cat >expected <<-\EOF &&
658
+ three
659
+ two
660
+ EOF
661
+ test_cmp expected actual
662
+'
663
+
664
test_done
t/t5539-fetch-http-shallow.sh
+25
@@ -73,5 +73,30 @@ test_expect_success 'no shallow lines after receiving ACK ready' '
73
)
74
'
75
76
+test_expect_success 'clone shallow since ...' '
77
+ test_create_repo shallow-since &&
78
+ (
79
+ cd shallow-since &&
80
+ GIT_COMMITTER_DATE="100000000 +0700" git commit --allow-empty -m one &&
81
+ GIT_COMMITTER_DATE="200000000 +0700" git commit --allow-empty -m two &&
82
+ GIT_COMMITTER_DATE="300000000 +0700" git commit --allow-empty -m three &&
83
+ mv .git "$HTTPD_DOCUMENT_ROOT_PATH/shallow-since.git" &&
84
+ git clone --shallow-since "300000000 +0700" $HTTPD_URL/smart/shallow-since.git ../shallow11 &&
85
+ git -C ../shallow11 log --pretty=tformat:%s HEAD >actual &&
86
+ echo three >expected &&
87
+ test_cmp expected actual
88
+ )
89
+'
90
+
91
+test_expect_success 'fetch shallow since ...' '
92
+ git -C shallow11 fetch --shallow-since "200000000 +0700" origin &&
93
+ git -C shallow11 log --pretty=tformat:%s origin/master >actual &&
94
+ cat >expected <<-\EOF &&
95
+ three
96
+ two
97
+ EOF
98
+ test_cmp expected actual
99
+'
100
+
101
stop_httpd
102
test_done