rev-parse --abbrev: do not try abbrev shorter than minimum.
We do not allow abbreviation shorter than 4 letters in other parts of the system so do not attempt to generate such. Noticed by Uwe Zeisberger. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
b2d4c56f2f
commit
1dc4fb84b5
@ -206,8 +206,10 @@ int main(int argc, char **argv)
|
|||||||
abbrev = DEFAULT_ABBREV;
|
abbrev = DEFAULT_ABBREV;
|
||||||
if (arg[8] == '=')
|
if (arg[8] == '=')
|
||||||
abbrev = strtoul(arg + 9, NULL, 10);
|
abbrev = strtoul(arg + 9, NULL, 10);
|
||||||
if (abbrev < 0 || 40 <= abbrev)
|
if (abbrev < MINIMUM_ABBREV)
|
||||||
abbrev = DEFAULT_ABBREV;
|
abbrev = MINIMUM_ABBREV;
|
||||||
|
else if (40 <= abbrev)
|
||||||
|
abbrev = 40;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!strcmp(arg, "--sq")) {
|
if (!strcmp(arg, "--sq")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user