summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-06-30 18:55:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-06-30 18:55:37 (GMT)
commite1165dd1442017c2b2722027168c497640f25746 (patch)
tree6b1d95aa8cd3a213bfee6eee59de308da028068a /diff.c
parentc9eaaab4165d8f402930d12899ec097495b599e6 (diff)
parent6ed7ddaadba9217b794aecf6d74a2e455daf7a96 (diff)
downloadgit-e1165dd1442017c2b2722027168c497640f25746.zip
git-e1165dd1442017c2b2722027168c497640f25746.tar.gz
git-e1165dd1442017c2b2722027168c497640f25746.tar.bz2
Merge branch 'jl/maint-diff-ignore-submodules'
* jl/maint-diff-ignore-submodules: t4027,4041: Use test -s to test for an empty file Add optional parameters to the diff option "--ignore-submodules" git diff: rename test that had a conflicting name
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index 2332fa6..9d70f9d 100644
--- a/diff.c
+++ b/diff.c
@@ -3169,7 +3169,16 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
DIFF_OPT_CLR(options, ALLOW_TEXTCONV);
else if (!strcmp(arg, "--ignore-submodules"))
DIFF_OPT_SET(options, IGNORE_SUBMODULES);
- else if (!strcmp(arg, "--submodule"))
+ else if (!prefixcmp(arg, "--ignore-submodules=")) {
+ if (!strcmp(arg + 20, "all"))
+ DIFF_OPT_SET(options, IGNORE_SUBMODULES);
+ else if (!strcmp(arg + 20, "untracked"))
+ DIFF_OPT_SET(options, IGNORE_UNTRACKED_IN_SUBMODULES);
+ else if (!strcmp(arg + 20, "dirty"))
+ DIFF_OPT_SET(options, IGNORE_DIRTY_SUBMODULES);
+ else
+ die("bad --ignore-submodules argument: %s", arg + 20);
+ } else if (!strcmp(arg, "--submodule"))
DIFF_OPT_SET(options, SUBMODULE_LOG);
else if (!prefixcmp(arg, "--submodule=")) {
if (!strcmp(arg + 12, "log"))