]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5539-fetch-http-shallow.sh
t5500, t5539: tests for shallow depth since a specific date
[thirdparty/git.git] / t / t5539-fetch-http-shallow.sh
index 37a433504e27f8dffc9bbbb9e94d550de20ff035..704753c8422dfc99a7ef5577a372f4197d29ea21 100755 (executable)
@@ -73,5 +73,30 @@ test_expect_success 'no shallow lines after receiving ACK ready' '
        )
 '
 
+test_expect_success 'clone shallow since ...' '
+       test_create_repo shallow-since &&
+       (
+       cd shallow-since &&
+       GIT_COMMITTER_DATE="100000000 +0700" git commit --allow-empty -m one &&
+       GIT_COMMITTER_DATE="200000000 +0700" git commit --allow-empty -m two &&
+       GIT_COMMITTER_DATE="300000000 +0700" git commit --allow-empty -m three &&
+       mv .git "$HTTPD_DOCUMENT_ROOT_PATH/shallow-since.git" &&
+       git clone --shallow-since "300000000 +0700" $HTTPD_URL/smart/shallow-since.git ../shallow11 &&
+       git -C ../shallow11 log --pretty=tformat:%s HEAD >actual &&
+       echo three >expected &&
+       test_cmp expected actual
+       )
+'
+
+test_expect_success 'fetch shallow since ...' '
+       git -C shallow11 fetch --shallow-since "200000000 +0700" origin &&
+       git -C shallow11 log --pretty=tformat:%s origin/master >actual &&
+       cat >expected <<-\EOF &&
+       three
+       two
+       EOF
+       test_cmp expected actual
+'
+
 stop_httpd
 test_done