aboutsummaryrefslogtreecommitdiff
path: root/builtin-merge.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-03-21 13:17:30 -0700
committerJunio C Hamano <gitster@pobox.com>2009-03-22 23:44:08 -0700
commita552de75eb01f78046feaf7dc88e5e4833624ad5 (patch)
treed069272f15dc3876743f24ed75c43f4209c004b4 /builtin-merge.c
parent431b1969fcde69959a23355fba6894fb69c8fa0c (diff)
downloadgit-a552de75eb01f78046feaf7dc88e5e4833624ad5.tar.gz
git-a552de75eb01f78046feaf7dc88e5e4833624ad5.tar.xz
strbuf_branchname(): a wrapper for branch name shorthands
The function takes a user-supplied string that is supposed to be a branch name, and puts it in a strbuf after expanding possible shorthand notation. A handful of open coded sequence to do this in the existing code have been changed to use this helper function. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-merge.c')
-rw-r--r--builtin-merge.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/builtin-merge.c b/builtin-merge.c
index e94ea7c35..6a51823a5 100644
--- a/builtin-merge.c
+++ b/builtin-merge.c
@@ -360,9 +360,8 @@ static void merge_name(const char *remote, struct strbuf *msg)
const char *ptr;
int len, early;
- len = strlen(remote);
- if (interpret_branch_name(remote, &bname) == len)
- remote = bname.buf;
+ strbuf_branchname(&bname, remote);
+ remote = bname.buf;
memset(branch_head, 0, sizeof(branch_head));
remote_head = peel_to_type(remote, 0, NULL, OBJ_COMMIT);