aboutsummaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-04-06 00:42:31 -0700
committerJunio C Hamano <gitster@pobox.com>2009-04-06 00:42:31 -0700
commitccc852c37751c7bc8f81bfb71e6722291270bca5 (patch)
tree8c4ff38a86383bba8d178fed191b2ebc521e91d6 /remote.c
parent87d2062b3984af5347519c38877b99bce06e6e8d (diff)
parent5e6e2b487e76066d03b4f5809dc6b44b1234519a (diff)
downloadgit-ccc852c37751c7bc8f81bfb71e6722291270bca5.tar.gz
git-ccc852c37751c7bc8f81bfb71e6722291270bca5.tar.xz
Merge branch 'mg/tracked-local-branches'
* mg/tracked-local-branches: Make local branches behave like remote branches when --tracked Test for local branches being followed with --track
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/remote.c b/remote.c
index 2b037f11b..d12140e0f 100644
--- a/remote.c
+++ b/remote.c
@@ -1170,8 +1170,9 @@ struct branch *branch_get(const char *name)
for (i = 0; i < ret->merge_nr; i++) {
ret->merge[i] = xcalloc(1, sizeof(**ret->merge));
ret->merge[i]->src = xstrdup(ret->merge_name[i]);
- remote_find_tracking(ret->remote,
- ret->merge[i]);
+ if (remote_find_tracking(ret->remote, ret->merge[i])
+ && !strcmp(ret->remote_name, "."))
+ ret->merge[i]->dst = xstrdup(ret->merge_name[i]);
}
}
}
@@ -1451,6 +1452,8 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)
base = branch->merge[0]->dst;
if (!prefixcmp(base, "refs/remotes/")) {
base += strlen("refs/remotes/");
+ } else if (!prefixcmp(base, "refs/heads/")) {
+ base += strlen("refs/heads/");
}
if (!num_theirs)
strbuf_addf(sb, "Your branch is ahead of '%s' "