diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-04-06 00:42:31 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-04-06 00:42:31 -0700 |
commit | ccc852c37751c7bc8f81bfb71e6722291270bca5 (patch) | |
tree | 8c4ff38a86383bba8d178fed191b2ebc521e91d6 /remote.c | |
parent | 87d2062b3984af5347519c38877b99bce06e6e8d (diff) | |
parent | 5e6e2b487e76066d03b4f5809dc6b44b1234519a (diff) | |
download | git-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.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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' " |