#!/bin/sh global test_description := ''avoiding conflicting update thru symref aliasing'' source ./test-lib.sh test_expect_success 'setup' ' test_commit one && git clone . src && git clone src dst1 && git clone src dst2 && test_commit two && ( cd src && git pull ) ' test_expect_success 'push' ' ( cd src && git push ../dst1 "refs/remotes/*:refs/remotes/*" ) && git ls-remote src "refs/remotes/*" >expect && git ls-remote dst1 "refs/remotes/*" >actual && test_cmp expect actual && ( cd src && git symbolic-ref refs/remotes/origin/HEAD ) >expect && ( cd dst1 && git symbolic-ref refs/remotes/origin/HEAD ) >actual && test_cmp expect actual ' test_expect_success 'fetch' ' ( cd dst2 && git fetch ../src "refs/remotes/*:refs/remotes/*" ) && git ls-remote src "refs/remotes/*" >expect && git ls-remote dst2 "refs/remotes/*" >actual && test_cmp expect actual && ( cd src && git symbolic-ref refs/remotes/origin/HEAD ) >expect && ( cd dst2 && git symbolic-ref refs/remotes/origin/HEAD ) >actual && test_cmp expect actual ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"avoiding conflicting update thru symref aliasing">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ )} { (SQ <"\n"> <"\ttest_commit one &&\n"> <"\tgit clone . src &&\n"> <"\tgit clone src dst1 &&\n"> <"\tgit clone src dst2 &&\n"> <"\ttest_commit two &&\n"> <"\t( cd src && git pull )\n"> ) } ) (C {(test_expect_success)} {(SQ )} { (SQ <"\n"> <"\t(\n"> <"\t\tcd src &&\n"> <"\t\tgit push ../dst1 \"refs/remotes/*:refs/remotes/*\"\n"> <"\t) &&\n"> <"\tgit ls-remote src \"refs/remotes/*\" >expect &&\n"> <"\tgit ls-remote dst1 \"refs/remotes/*\" >actual &&\n"> <"\ttest_cmp expect actual &&\n"> <"\t( cd src && git symbolic-ref refs/remotes/origin/HEAD ) >expect &&\n"> <"\t( cd dst1 && git symbolic-ref refs/remotes/origin/HEAD ) >actual &&\n"> <"\ttest_cmp expect actual\n"> ) } ) (C {(test_expect_success)} {(SQ )} { (SQ <"\n"> <"\t(\n"> <"\t\tcd dst2 &&\n"> <"\t\tgit fetch ../src \"refs/remotes/*:refs/remotes/*\"\n"> <"\t) &&\n"> <"\tgit ls-remote src \"refs/remotes/*\" >expect &&\n"> <"\tgit ls-remote dst2 \"refs/remotes/*\" >actual &&\n"> <"\ttest_cmp expect actual &&\n"> <"\t( cd src && git symbolic-ref refs/remotes/origin/HEAD ) >expect &&\n"> <"\t( cd dst2 && git symbolic-ref refs/remotes/origin/HEAD ) >actual &&\n"> <"\ttest_cmp expect actual\n"> ) } ) (C {(test_done)}) ] )