diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2010-08-17 01:52:48 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-08-18 14:02:02 -0700 |
commit | b81f925f709a10b37fb4fcd03629b55bc890a478 (patch) | |
tree | 915874e3e43dc2615104b2fceca2ea5ecfffa1e5 /builtin | |
parent | Git 1.7.2 (diff) | |
download | tgif-b81f925f709a10b37fb4fcd03629b55bc890a478.tar.xz |
merge: do not mistake (ancestor of) tag for branch
If no branch 'foo' exists but a tag 'foo' does, then
git merge foo^ results in
Merge branch 'foo' (early part)
as a commit message, because the relevant code path checks that
refs/heads/foo is a valid refname for writing rather than for
reading.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/merge.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/merge.c b/builtin/merge.c index 37ce4f589f..2207f79969 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -437,7 +437,7 @@ static void merge_name(const char *remote, struct strbuf *msg) strbuf_addstr(&truname, "refs/heads/"); strbuf_addstr(&truname, remote); strbuf_setlen(&truname, truname.len - len); - if (resolve_ref(truname.buf, buf_sha, 0, NULL)) { + if (resolve_ref(truname.buf, buf_sha, 1, NULL)) { strbuf_addf(msg, "%s\t\tbranch '%s'%s of .\n", sha1_to_hex(remote_head->sha1), |