projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cvsexportcommit: add some examples to the documentation
[git.git]
/
diff.c
diff --git
a/diff.c
b/diff.c
index
17d68fa
..
8ae6dbc
100644
(file)
--- a/
diff.c
+++ b/
diff.c
@@
-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];
if (memcmp(one->sha1, two->sha1, 20)) {
char one_sha1[41];
- int abbrev = o->full_index ? 40 : D
IFF_DEFAULT_INDEX
_ABBREV;
+ int abbrev = o->full_index ? 40 : D
EFAULT
_ABBREV;
memcpy(one_sha1, sha1_to_hex(one->sha1), 41);
len += snprintf(msg + len, sizeof(msg) - len,
memcpy(one_sha1, sha1_to_hex(one->sha1), 41);
len += snprintf(msg + len, sizeof(msg) - len,
@@
-846,9
+846,14
@@
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"))
else if (!strcmp(arg, "--find-copies-harder"))
options->find_copies_harder = 1;
else if (!strcmp(arg, "--abbrev"))
- options->abbrev = D
IFF_D
EFAULT_ABBREV;
- else if (!strncmp(arg, "--abbrev=", 9))
+ options->abbrev = DEFAULT_ABBREV;
+ else if (!strncmp(arg, "--abbrev=", 9))
{
options->abbrev = strtoul(arg + 9, NULL, 10);
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;
else
return 0;
return 1;