Merge branch 'jk/format-patch-from' into maint
[gitweb.git] / t / t3200-branch.sh
index 8f6ab8e16054bb629768c70c44045f32f6b7722e..55c9ab0b6a5c65aacdb3ef6107c3417d7bdc4e00 100755 (executable)
@@ -871,4 +871,39 @@ test_expect_success '--merged catches invalid object names' '
        test_must_fail git branch --merged 0000000000000000000000000000000000000000
 '
 
+test_expect_success 'tracking with unexpected .fetch refspec' '
+       rm -rf a b c d &&
+       git init a &&
+       (
+               cd a &&
+               test_commit a
+       ) &&
+       git init b &&
+       (
+               cd b &&
+               test_commit b
+       ) &&
+       git init c &&
+       (
+               cd c &&
+               test_commit c &&
+               git remote add a ../a &&
+               git remote add b ../b &&
+               git fetch --all
+       ) &&
+       git init d &&
+       (
+               cd d &&
+               git remote add c ../c &&
+               git config remote.c.fetch "+refs/remotes/*:refs/remotes/*" &&
+               git fetch c &&
+               git branch --track local/a/master remotes/a/master &&
+               test "$(git config branch.local/a/master.remote)" = "c" &&
+               test "$(git config branch.local/a/master.merge)" = "refs/remotes/a/master" &&
+               git rev-parse --verify a >expect &&
+               git rev-parse --verify local/a/master >actual &&
+               test_cmp expect actual
+       )
+'
+
 test_done