summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f2d4227)
raw | patch | inline | side by side (parent: f2d4227)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 27 Jan 2006 10:19:51 +0000 (02:19 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 28 Jan 2006 08:09:39 +0000 (00:09 -0800) |
Earier specifying an abbreviation shorter than minimum fell back
to full 40 letters, which was nonsense. Make it to fall back to
the minimum number (currently 4).
Signed-off-by: Junio C Hamano <junkio@cox.net>
to full 40 letters, which was nonsense. Make it to fall back to
the minimum number (currently 4).
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff.c | patch | blob | history |
index 69767b9de97f27306032d7af1aa05d0bdbf5315f..8ae6dbc64e3c6c96e37755644d14998dc6e44a5a 100644 (file)
--- a/diff.c
+++ b/diff.c
options->find_copies_harder = 1;
else if (!strcmp(arg, "--abbrev"))
options->abbrev = DEFAULT_ABBREV;
- else if (!strncmp(arg, "--abbrev=", 9))
+ else if (!strncmp(arg, "--abbrev=", 9)) {
options->abbrev = strtoul(arg + 9, NULL, 10);
+ if (options->abbrev < MINIMUM_ABBREV)
+ options->abbrev = MINIMUM_ABBREV;
+ else if (40 < options->abbrev)
+ options->abbrev = 40;
+ }
else
return 0;
return 1;