#!/bin/sh global test_description := ''fetch follows remote-tracking branches correctly'' source ./test-lib.sh test_expect_success setup ' >file && git add . && test_tick && git commit -m Initial && git branch b-0 && git branch b1 && git branch b/one && test_create_repo other && ( cd other && git config remote.origin.url .. && git config remote.origin.fetch "+refs/heads/b/*:refs/remotes/b/*" ) ' test_expect_success fetch ' ( cd other && git fetch origin && test "$(git for-each-ref --format="%(refname)")" = refs/remotes/b/one ) ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"fetch follows remote-tracking branches correctly">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(setup)} { (SQ <"\n"> <"\t>file &&\n"> <"\tgit add . &&\n"> <"\ttest_tick &&\n"> <"\tgit commit -m Initial &&\n"> <"\tgit branch b-0 &&\n"> <"\tgit branch b1 &&\n"> <"\tgit branch b/one &&\n"> <"\ttest_create_repo other &&\n"> <"\t(\n"> <"\t\tcd other &&\n"> <"\t\tgit config remote.origin.url .. &&\n"> <"\t\tgit config remote.origin.fetch \"+refs/heads/b/*:refs/remotes/b/*\"\n"> <"\t)\n"> ) } ) (C {(test_expect_success)} {(fetch)} { (SQ <"\n"> <"\t(\n"> <"\t\tcd other && git fetch origin &&\n"> <"\t\ttest \"$(git for-each-ref --format=\"%(refname)\")\" = refs/remotes/b/one\n"> <"\t)\n"> ) } ) (C {(test_done)}) ] )