Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
diff: use skip_to_optional_arg_default() in parsing --relative
author
Junio C Hamano
<gitster@pobox.com>
Sat, 9 Dec 2017 20:40:11 +0000
(21:40 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 12 Dec 2017 00:10:12 +0000
(16:10 -0800)
Helped-by: Jacob Keller <jacob.keller@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
cf81f94
)
diff --git
a/diff.c
b/diff.c
index 28e1ab168f423f76bb9a1bdc163157d4432195bf..3f14cdace6930140657423d26277c6ff38d22da5 100644
(file)
--- a/
diff.c
+++ b/
diff.c
@@
-4563,11
+4563,10
@@
int diff_opt_parse(struct diff_options *options,
options->flags.rename_empty = 1;
else if (!strcmp(arg, "--no-rename-empty"))
options->flags.rename_empty = 0;
options->flags.rename_empty = 1;
else if (!strcmp(arg, "--no-rename-empty"))
options->flags.rename_empty = 0;
- else if (
!strcmp(arg, "--relative"))
+ else if (
skip_to_optional_arg_default(arg, "--relative", &arg, NULL)) {
options->flags.relative_name = 1;
options->flags.relative_name = 1;
- else if (skip_prefix(arg, "--relative=", &arg)) {
- options->flags.relative_name = 1;
- options->prefix = arg;
+ if (arg)
+ options->prefix = arg;
}
/* xdiff options */
}
/* xdiff options */