Merge branch 'dl/stash-show-untracked-fixup'

Another brown paper bag inconsistency fix for a new feature
introduced during this cycle.

* dl/stash-show-untracked-fixup:
  stash show: use stash.showIncludeUntracked even when diff options given
diff --git a/Documentation/config/stash.txt b/Documentation/config/stash.txt
index 413f907..9ed7752 100644
--- a/Documentation/config/stash.txt
+++ b/Documentation/config/stash.txt
@@ -6,9 +6,9 @@
 	remaining users that setting this now does nothing.
 
 stash.showIncludeUntracked::
-	If this is set to true, the `git stash show` command without an
-	option will show the untracked files of a stash entry.  Defaults to
-	false. See description of 'show' command in linkgit:git-stash[1].
+	If this is set to true, the `git stash show` command will show
+	the untracked files of a stash entry.  Defaults to false. See
+	description of 'show' command in linkgit:git-stash[1].
 
 stash.showPatch::
 	If this is set to true, the `git stash show` command without an
diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index a8c8c32..be6084c 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -91,8 +91,10 @@
 	By default, the command shows the diffstat, but it will accept any
 	format known to 'git diff' (e.g., `git stash show -p stash@{1}`
 	to view the second most recent entry in patch form).
-	You can use stash.showIncludeUntracked, stash.showStat, and
-	stash.showPatch config variables to change the default behavior.
+	If no `<diff-option>` is provided, the default behavior will be given
+	by the `stash.showStat`, and `stash.showPatch` config variables. You
+	can also use `stash.showIncludeUntracked` to set whether
+	`--include-untracked` is enabled by default.
 
 pop [--index] [-q|--quiet] [<stash>]::
 
diff --git a/builtin/stash.c b/builtin/stash.c
index 56a33fb..01066d7 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -833,7 +833,7 @@
 		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"),
@@ -876,9 +876,6 @@
 		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;
diff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh
index 5bed8fd..dd2cdcc 100755
--- a/t/t3905-stash-include-untracked.sh
+++ b/t/t3905-stash-include-untracked.sh
@@ -333,6 +333,8 @@
 	git stash show -p --include-untracked >actual &&
 	test_cmp expect actual &&
 	git stash show --include-untracked -p >actual &&
+	test_cmp expect actual &&
+	git -c stash.showIncludeUntracked=true stash show -p >actual &&
 	test_cmp expect actual
 '