diff options
author | Junio C Hamano <junkio@cox.net> | 2006-01-25 01:03:18 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-01-28 00:09:38 -0800 |
commit | 46a6c2620ba421397eec627b8eb18eb530e694fc (patch) | |
tree | 9222e809b0d77ad10e7304073d4c053c7edd9266 /diff.c | |
parent | merge: seed the commit message with list of conflicted files. (diff) | |
download | tgif-46a6c2620ba421397eec627b8eb18eb530e694fc.tar.xz |
abbrev cleanup: use symbolic constants
The minimum length of abbreviated object name was hardcoded in
different places to be 4, risking inconsistencies in the future.
Also there were three different "default abbreviation
precision". Use two C preprocessor symbols to clean up this
mess.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -723,7 +723,7 @@ static void run_diff(struct diff_filepair *p, struct diff_options *o) if (memcmp(one->sha1, two->sha1, 20)) { char one_sha1[41]; - int abbrev = o->full_index ? 40 : DIFF_DEFAULT_INDEX_ABBREV; + int abbrev = o->full_index ? 40 : DEFAULT_ABBREV; memcpy(one_sha1, sha1_to_hex(one->sha1), 41); len += snprintf(msg + len, sizeof(msg) - len, @@ -846,7 +846,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac) else if (!strcmp(arg, "--find-copies-harder")) options->find_copies_harder = 1; else if (!strcmp(arg, "--abbrev")) - options->abbrev = DIFF_DEFAULT_ABBREV; + options->abbrev = DEFAULT_ABBREV; else if (!strncmp(arg, "--abbrev=", 9)) options->abbrev = strtoul(arg + 9, NULL, 10); else |