Browse Source
The auto-tag-following code in "git fetch" tries to reuse the same transport twice when the serving end does not cooperate and does not give tags that point to commits that are asked for as part of the primary transfer. Unfortunately, Git-aware transport helper interface is not designed to be used more than once, hence this does not work over smart-http transfer. * jc/transport-do-not-use-connect-twice-in-fetch: builtin/fetch.c: Fix a sparse warning fetch: work around "transport-take-over" hack fetch: refactor code that fetches leftover tags fetch: refactor code that prepares a transport fetch: rename file-scope global "transport" to "gtransport" t5802: add test for connect helpermaint

4 changed files with 134 additions and 31 deletions
@ -0,0 +1,72 @@
@@ -0,0 +1,72 @@
|
||||
#!/bin/sh |
||||
|
||||
test_description='ext::cmd remote "connect" helper' |
||||
. ./test-lib.sh |
||||
|
||||
test_expect_success setup ' |
||||
test_tick && |
||||
git commit --allow-empty -m initial && |
||||
test_tick && |
||||
git commit --allow-empty -m second && |
||||
test_tick && |
||||
git commit --allow-empty -m third && |
||||
test_tick && |
||||
git tag -a -m "tip three" three && |
||||
|
||||
test_tick && |
||||
git commit --allow-empty -m fourth |
||||
' |
||||
|
||||
test_expect_success clone ' |
||||
cmd=$(echo "echo >&2 ext::sh invoked && %S .." | sed -e "s/ /% /g") && |
||||
git clone "ext::sh -c %S% ." dst && |
||||
git for-each-ref refs/heads/ refs/tags/ >expect && |
||||
( |
||||
cd dst && |
||||
git config remote.origin.url "ext::sh -c $cmd" && |
||||
git for-each-ref refs/heads/ refs/tags/ |
||||
) >actual && |
||||
test_cmp expect actual |
||||
' |
||||
|
||||
test_expect_success 'update following tag' ' |
||||
test_tick && |
||||
git commit --allow-empty -m fifth && |
||||
test_tick && |
||||
git tag -a -m "tip five" five && |
||||
git for-each-ref refs/heads/ refs/tags/ >expect && |
||||
( |
||||
cd dst && |
||||
git pull && |
||||
git for-each-ref refs/heads/ refs/tags/ >../actual |
||||
) && |
||||
test_cmp expect actual |
||||
' |
||||
|
||||
test_expect_success 'update backfilled tag' ' |
||||
test_tick && |
||||
git commit --allow-empty -m sixth && |
||||
test_tick && |
||||
git tag -a -m "tip two" two three^1 && |
||||
git for-each-ref refs/heads/ refs/tags/ >expect && |
||||
( |
||||
cd dst && |
||||
git pull && |
||||
git for-each-ref refs/heads/ refs/tags/ >../actual |
||||
) && |
||||
test_cmp expect actual |
||||
' |
||||
|
||||
test_expect_success 'update backfilled tag without primary transfer' ' |
||||
test_tick && |
||||
git tag -a -m "tip one " one two^1 && |
||||
git for-each-ref refs/heads/ refs/tags/ >expect && |
||||
( |
||||
cd dst && |
||||
git pull && |
||||
git for-each-ref refs/heads/ refs/tags/ >../actual |
||||
) && |
||||
test_cmp expect actual |
||||
' |
||||
|
||||
test_done |
Loading…
Reference in new issue