diff options
author | Denton Liu <liu.denton@gmail.com> | 2021-05-21 03:37:47 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-05-22 17:56:46 +0900 |
commit | af5cd44b6f8f1934bc8b91f646eb2e73dcab57f3 (patch) | |
tree | 9aeafe86f27bdd089aa9cb078b507755de370a0d /builtin | |
parent | stash show: fix segfault with --{include,only}-untracked (diff) | |
download | tgif-af5cd44b6f8f1934bc8b91f646eb2e73dcab57f3.tar.xz |
stash show: use stash.showIncludeUntracked even when diff options given
If options pertaining to how the diff is displayed is provided to
`git stash show`, the command will ignore the stash.showIncludeUntracked
configuration variable, defaulting to not showing any untracked files.
This is unintuitive behaviour since the format of the diff output and
whether or not to display untracked files are orthogonal.
Use stash.showIncludeUntracked even when diff options are given. Of
course, this is still overridable via the command-line options.
Update the documentation to explicitly say which configuration variables
will be overridden when a diff options are given.
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/stash.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/builtin/stash.c b/builtin/stash.c index 82e4829d44..864b6c1416 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -831,7 +831,7 @@ static int show_stash(int argc, const char **argv, const char *prefix) UNTRACKED_NONE, UNTRACKED_INCLUDE, UNTRACKED_ONLY - } show_untracked = UNTRACKED_NONE; + } show_untracked = show_include_untracked ? UNTRACKED_INCLUDE : UNTRACKED_NONE; struct option options[] = { OPT_SET_INT('u', "include-untracked", &show_untracked, N_("include untracked files in the stash"), @@ -874,9 +874,6 @@ static int show_stash(int argc, const char **argv, const char *prefix) if (show_patch) rev.diffopt.output_format |= DIFF_FORMAT_PATCH; - if (show_include_untracked) - show_untracked = UNTRACKED_INCLUDE; - if (!show_stat && !show_patch) { free_stash_info(&info); return 0; |