File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -637,4 +637,28 @@ test_expect_success MINGW 'fetch-pack --diag-url c:repo' '
637
637
check_prot_path c:repo file c:repo
638
638
'
639
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
+
640
664
test_done
Original file line number Diff line number Diff line change @@ -73,5 +73,30 @@ test_expect_success 'no shallow lines after receiving ACK ready' '
73
73
)
74
74
'
75
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
+
76
101
stop_httpd
77
102
test_done
You can’t perform that action at this time.
0 commit comments