X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft5510-fetch.sh;h=50c64856f0fd35fd14007e0603a1cf58ce702cec;hb=207dfa07919baba034291f1d5169f86272839d59;hp=e71581a95dd86949eab8c56d99d11f5f3ca3c3ba;hpb=7be1d62c6f6b322d826d145762db0050057aeb69;p=git.git diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index e71581a95..50c64856f 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -22,11 +22,20 @@ test_expect_success "clone and setup child repos" ' cd .. && git clone . two && cd two && - git repo-config branch.master.remote one && + git config branch.master.remote one && + git config remote.one.url ../one/.git/ && + git config remote.one.fetch refs/heads/master:refs/heads/one && + cd .. && + git clone . three && + cd three && + git config branch.master.remote two && + git config branch.master.merge refs/heads/one && + mkdir -p .git/remotes && { - echo "URL: ../one/.git/" - echo "Pull: refs/heads/master:refs/heads/one" - } >.git/remotes/one + echo "URL: ../two/.git/" + echo "Pull: refs/heads/master:refs/heads/two" + echo "Pull: refs/heads/one:refs/heads/one" + } >.git/remotes/two ' test_expect_success "fetch test" ' @@ -41,4 +50,35 @@ test_expect_success "fetch test" ' test "z$mine" = "z$his" ' +test_expect_success "fetch test for-merge" ' + cd "$D" && + cd three && + git fetch && + test -f .git/refs/heads/two && + test -f .git/refs/heads/one && + master_in_two=`cd ../two && git rev-parse master` && + one_in_two=`cd ../two && git rev-parse one` && + { + echo "$master_in_two not-for-merge" + echo "$one_in_two " + } >expected && + cut -f -2 .git/FETCH_HEAD >actual && + diff expected actual' + +test_expect_success 'fetch following tags' ' + + cd "$D" && + git tag -a -m 'annotated' anno HEAD && + git tag light HEAD && + + mkdir four && + cd four && + git init && + + git fetch .. :track && + git show-ref --verify refs/tags/anno && + git show-ref --verify refs/tags/light + +' + test_done