summaryrefslogtreecommitdiff
path: root/t/t3200-branch.sh
diff options
context:
space:
mode:
authorPer Cederqvist <cederp@opera.com>2013-09-08 20:58:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-09-09 18:03:20 (GMT)
commit1d7358c5245cd7e290146ccf96407dc8a805f314 (patch)
tree83d79dac698feae194e66e34f696a211edac8930 /t/t3200-branch.sh
parent62d94a3aa6cc0f43f150af1d5549ca5f7b25fe0b (diff)
downloadgit-1d7358c5245cd7e290146ccf96407dc8a805f314.zip
git-1d7358c5245cd7e290146ccf96407dc8a805f314.tar.gz
git-1d7358c5245cd7e290146ccf96407dc8a805f314.tar.bz2
branch.c: Relax unnecessary requirement on upstream's remote ref name
When creating an upstream relationship, we use the configured remotes and their refspecs to determine the upstream configuration settings branch.<name>.remote and branch.<name>.merge. However, if the matching refspec does not have refs/heads/<something> on the remote side, we end up rejecting the match, and failing the upstream configuration. It could be argued that when we set up an branch's upstream, we want that upstream to also be a proper branch in the remote repo. Although this is typically the common case, there are cases (as demonstrated by the previous patch in this series) where this requirement prevents a useful upstream relationship from being formed. Furthermore: - We have fundamentally no say in how the remote repo have organized its branches. The remote repo may put branches (or branch-like constructs that are insteresting for downstreams to track) outside refs/heads/*. - The user may intentionally want to track a non-branch from a remote repo, by using a branch and configured upstream in the local repo. Relaxing the checking to only require a matching remote/refspec allows the testcase introduced in the previous patch to succeed, and has no negative effect on the rest of the test suite. This patch fixes a behavior (arguably a regression) first introduced in 41c21f2 (branch.c: Validate tracking branches with refspecs instead of refs/remotes/*) on 2013-04-21 (released in >= v1.8.3.2). Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3200-branch.sh')
-rwxr-xr-xt/t3200-branch.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 4031693..f010303 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -871,7 +871,7 @@ test_expect_success '--merged catches invalid object names' '
test_must_fail git branch --merged 0000000000000000000000000000000000000000
'
-test_expect_failure 'tracking with unexpected .fetch refspec' '
+test_expect_success 'tracking with unexpected .fetch refspec' '
git init a &&
(
cd a &&