diff options
| author | Junio C Hamano <gitster@pobox.com> | 2008-05-25 13:37:08 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2008-05-25 13:37:08 -0700 |
| commit | 7e83003029ed488253f6173b047a9c77933c8561 (patch) | |
| tree | 191fd7e272b6adde953d76b974a3ed9de282b128 /diff.c | |
| parent | 58dd4915ba1a933af0087e351743e31b2f9be878 (diff) | |
| parent | 6848d58c60b7af365ce54cf3e3b274a2f9da2e7e (diff) | |
| download | git-7e83003029ed488253f6173b047a9c77933c8561.tar.gz | |
Merge branch 'js/ignore-submodule'
* js/ignore-submodule:
Ignore dirty submodule states during rebase and stash
Teach update-index about --ignore-submodules
diff options: Introduce --ignore-submodules
Diffstat (limited to 'diff.c')
| -rw-r--r-- | diff.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -2496,6 +2496,8 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac) DIFF_OPT_SET(options, ALLOW_EXTERNAL); else if (!strcmp(arg, "--no-ext-diff")) DIFF_OPT_CLR(options, ALLOW_EXTERNAL); + else if (!strcmp(arg, "--ignore-submodules")) + DIFF_OPT_SET(options, IGNORE_SUBMODULES); /* misc options */ else if (!strcmp(arg, "-z")) @@ -3355,6 +3357,9 @@ void diff_addremove(struct diff_options *options, char concatpath[PATH_MAX]; struct diff_filespec *one, *two; + if (DIFF_OPT_TST(options, IGNORE_SUBMODULES) && S_ISGITLINK(mode)) + return; + /* This may look odd, but it is a preparation for * feeding "there are unchanged files which should * not produce diffs, but when you are doing copy @@ -3399,6 +3404,10 @@ void diff_change(struct diff_options *options, char concatpath[PATH_MAX]; struct diff_filespec *one, *two; + if (DIFF_OPT_TST(options, IGNORE_SUBMODULES) && S_ISGITLINK(old_mode) + && S_ISGITLINK(new_mode)) + return; + if (DIFF_OPT_TST(options, REVERSE_DIFF)) { unsigned tmp; const unsigned char *tmp_c; |
