Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-03-21 23:17:30 +0300
committerJunio C Hamano <gitster@pobox.com>2009-03-23 09:44:08 +0300
commita552de75eb01f78046feaf7dc88e5e4833624ad5 (patch)
treed069272f15dc3876743f24ed75c43f4209c004b4 /builtin-branch.c
parent431b1969fcde69959a23355fba6894fb69c8fa0c (diff)
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-branch.c')
-rw-r--r--builtin-branch.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/builtin-branch.c b/builtin-branch.c
index cacd7daae7..7452db13c8 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -121,11 +121,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
die("Couldn't look up commit object for HEAD");
}
for (i = 0; i < argc; i++, strbuf_release(&bname)) {
- int len = strlen(argv[i]);
-
- if (interpret_branch_name(argv[i], &bname) != len)
- strbuf_add(&bname, argv[i], len);
-
+ strbuf_branchname(&bname, argv[i]);
if (kinds == REF_LOCAL_BRANCH && !strcmp(head, bname.buf)) {
error("Cannot delete the branch '%s' "
"which you are currently on.", bname.buf);