Skip to content

pr-751/sangu09/handle_untracked-v1

From: sangu09 <sangunb09@gmail.com>

Git diff reports a submodule directory as -dirty even when there are only untracked files in the submodule directory.
This is inconsistent with what `git describe --dirty` says when run in the submodule directory in that state.

So this patch makes `git diff HEAD` consistent with `git describe --dirty` in case of untracked files. This can be solved by including the "--ignore-submodules=untracked" feature in git diff by default. So in order to make this as default behaviour I have added the behaviour of `ignore-submodules` in `repo_diff_setup()` function. Also, to avoid `ignoreSubmodules` in user config being overwritten, I have made a  global variable `diff_ignore_submodule_config` to keep a track whether `handle_ignore_submodules_arg` is called before or not.

Signed-off-by: Sangeeta Jain <sangunb09@gmail.com>

Submitted-As: https://lore.kernel.org/git/pull.751.git.1602781723670.gitgitgadget@gmail.com
Assets 2