-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jc/transport-do-not-use-connect-twice-in-fetch'
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 helper
- Loading branch information
Showing
4 changed files
with
136 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters