aboutsummaryrefslogtreecommitdiff
path: root/builtin/branch.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2011-07-01 15:06:08 +0900
committerJunio C Hamano <gitster@pobox.com>2011-07-01 11:22:09 -0700
commitb792c067872a6b4ec6545dc4375a7084626cb0fa (patch)
tree6df2f73241079eb15d9c40c484536ad1730076f7 /builtin/branch.c
parent76c82f90abde8820461e042c6654673f1147881d (diff)
downloadgit-b792c067872a6b4ec6545dc4375a7084626cb0fa.tar.gz
git-b792c067872a6b4ec6545dc4375a7084626cb0fa.tar.xz
branch -v: honor core.abbrev
Use the value from 'core.abbrev' configuration variable unless user specifies the length on command line when showing commit object name in "branch -v" output. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/branch.c')
-rw-r--r--builtin/branch.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index 3142daa57..953bc1ca9 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -613,7 +613,7 @@ static int opt_parse_merge_filter(const struct option *opt, const char *arg, int
int cmd_branch(int argc, const char **argv, const char *prefix)
{
int delete = 0, rename = 0, force_create = 0;
- int verbose = 0, abbrev = DEFAULT_ABBREV, detached = 0;
+ int verbose = 0, abbrev = -1, detached = 0;
int reflog = 0;
enum branch_track track;
int kinds = REF_LOCAL_BRANCH;
@@ -696,6 +696,9 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
if (!!delete + !!rename + !!force_create > 1)
usage_with_options(builtin_branch_usage, options);
+ if (abbrev == -1)
+ abbrev = DEFAULT_ABBREV;
+
if (delete)
return delete_branches(argc, argv, delete > 1, kinds);
else if (argc == 0)