diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2019-05-29 12:11:15 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-05-29 21:04:32 +0300 |
commit | 8ef05193bcdda6a28cd41fa3ecd8f356061d49e0 (patch) | |
tree | d320df22f655cd124361fc5b93f564437dcb65de /t/t4013-diff-various.sh | |
parent | 7f125ff9094bfebbb381afa19380943a088c8fcb (diff) |
diff-parseopt: restore -U (no argument) behavior
Before d473e2e0e8 (diff.c: convert -U|--unified, 2019-01-27), -U and
--unified are implemented with a custom parser opt_arg() in diff.c. I
didn't check this code carefully and not realize that it's the
equivalent of PARSE_OPT_NONEG | PARSE_OPT_OPTARG.
In other words, if -U is specified without any argument, the option
should be accepted, and the default value should be used. Without
PARSE_OPT_OPTARG, parse_options() will reject this case and cause a
regression.
Reported-by: Bryan Turner <bturner@atlassian.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013-diff-various.sh')
-rwxr-xr-x | t/t4013-diff-various.sh | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index 7d985ff6b1..3c4a3dfcc1 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -330,6 +330,8 @@ format-patch --inline --stdout initial..master^^ format-patch --stdout --cover-letter -n initial..master^ diff --abbrev initial..side +diff -U initial..side +diff -U1 initial..side diff -r initial..side diff --stat initial..side diff -r --stat initial..side |