Merge branch 'jk/fetch-auto-tag-following-fix'

Fetching via protocol v0 over Smart HTTP transport sometimes failed
to correctly auto-follow tags.

* jk/fetch-auto-tag-following-fix:
  transport-helper: re-examine object dir after fetching
This commit is contained in:
Junio C Hamano
2024-02-02 11:31:51 -08:00
2 changed files with 21 additions and 0 deletions

View File

@ -733,4 +733,22 @@ test_expect_success 'no empty path components' '
! grep "//" log
'
test_expect_success 'tag following always works over v0 http' '
upstream=$HTTPD_DOCUMENT_ROOT_PATH/tags &&
git init "$upstream" &&
(
cd "$upstream" &&
git commit --allow-empty -m base &&
git tag not-annotated &&
git tag -m foo annotated
) &&
git init tags &&
git -C tags -c protocol.version=0 \
fetch --depth 1 $HTTPD_URL/smart/tags \
refs/tags/annotated:refs/tags/annotated &&
git -C "$upstream" for-each-ref refs/tags >expect &&
git -C tags for-each-ref >actual &&
test_cmp expect actual
'
test_done