This is part of enhancement request that ask for `git stash` to work even if 
`user.name` is not configured.
The issue is discussed here: 
https://public-inbox.org/git/87o9debty4....@evledraar.gmail.com/T/#u.

Signed-off-by: Slavica <slawic...@hotmail.com>
---
 t/t3903-stash.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 9e06494ba0..9ff34a65bc 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -1156,4 +1156,21 @@ test_expect_success 'stash -- <subdir> works with binary 
files' '
        test_path_is_file subdir/untracked
 '
 
+test_expect_failure 'stash with HOME as non-existing directory' '
+    test_commit 1 &&
+    test_config user.useconfigonly true &&
+    test_config stash.usebuiltin true &&
+    (
+        HOME=$(pwd)/none &&
+        export HOME &&
+        unset GIT_AUTHOR_NAME &&
+        unset GIT_AUTHOR_EMAIL &&
+        unset GIT_COMMITTER_NAME &&
+        unset GIT_COMMITTER_EMAIL &&
+        test_must_fail git config user.email &&
+        echo changed >1.t &&
+               git stash
+    )
+'
+
 test_done
-- 
2.19.1.windows.1

Reply via email to