(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"Test git stash --include-untracked">)} spids: [13] ) ] spids: [13] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ <"stash save --include-untracked some dirty working directory">)} { (SQ <"\n"> <"\techo 1 > file &&\n"> <"\tgit add file &&\n"> <"\ttest_tick &&\n"> <"\tgit commit -m initial &&\n"> <"\techo 2 > file &&\n"> <"\tgit add file &&\n"> <"\techo 3 > file &&\n"> <"\ttest_tick &&\n"> <"\techo 1 > file2 &&\n"> <"\techo 1 > HEAD &&\n"> <"\tmkdir untracked &&\n"> <"\techo untracked >untracked/untracked &&\n"> <"\tgit stash --include-untracked &&\n"> <"\tgit diff-files --quiet &&\n"> <"\tgit diff-index --cached --quiet HEAD\n"> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[52]) (HereDoc op_id: Redir_DLess fd: -1 body: {(DQ ("?? actual\n") ("?? expect\n"))} do_expansion: True here_end: EOF was_filled: True spids: [56] ) ] ) (C {(test_expect_success)} {(SQ <"stash save --include-untracked cleaned the untracked files">)} {(SQ <"\n"> <"\tgit status --porcelain >actual &&\n"> <"\ttest_cmp expect actual\n">)} ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(expect.diff)} spids:[77]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("diff --git a/HEAD b/HEAD\n") ("new file mode 100644\n") ("index 0000000..d00491f\n") ("--- /dev/null\n") ("+++ b/HEAD\n") ("@@ -0,0 +1 @@\n") ("+1\n") ("diff --git a/file2 b/file2\n") ("new file mode 100644\n") ("index 0000000..d00491f\n") ("--- /dev/null\n") ("+++ b/file2\n") ("@@ -0,0 +1 @@\n") ("+1\n") ("diff --git a/untracked/untracked b/untracked/untracked\n") ("new file mode 100644\n") ("index 0000000..5a72eb2\n") ("--- /dev/null\n") ("+++ b/untracked/untracked\n") ("@@ -0,0 +1 @@\n") ("+untracked\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [81] ) ] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(expect.lstree)} spids:[107]) (HereDoc op_id: Redir_DLess fd: -1 body: {(DQ ("HEAD\n") ("file2\n") ("untracked\n"))} do_expansion: True here_end: EOF was_filled: True spids: [111] ) ] ) (C {(test_expect_success)} {(SQ <"stash save --include-untracked stashed the untracked files">)} { (SQ <"\n"> <"\ttest_path_is_missing file2 &&\n"> <"\ttest_path_is_missing untracked &&\n"> <"\ttest_path_is_missing HEAD &&\n"> <"\tgit diff HEAD stash^3 -- HEAD file2 untracked >actual &&\n"> <"\ttest_cmp expect.diff actual &&\n"> <"\tgit ls-tree --name-only stash^3: >actual &&\n"> <"\ttest_cmp expect.lstree actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"stash save --patch --include-untracked fails">)} {(SQ <"\n"> <"\ttest_must_fail git stash --patch --include-untracked\n">)} ) (C {(test_expect_success)} {(SQ <"stash save --patch --all fails">)} {(SQ <"\n"> <"\ttest_must_fail git stash --patch --all\n">)} ) (C {(git)} {(clean)} {(--force)} {(--quiet)}) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[170]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ (" M file\n") ("?? HEAD\n") ("?? actual\n") ("?? expect\n") ("?? file2\n") ("?? untracked/\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [174] ) ] ) (C {(test_expect_success)} {(SQ <"stash pop after save --include-untracked leaves files untracked again">)} { (SQ <"\n"> <"\tgit stash pop &&\n"> <"\tgit status --porcelain >actual &&\n"> <"\ttest_cmp expect actual &&\n"> <"\ttest \"1\" = \"$(cat file2)\" &&\n"> <"\ttest untracked = \"$(cat untracked/untracked)\"\n"> ) } ) (C {(git)} {(clean)} {(--force)} {(--quiet)} {(-d)}) (C {(test_expect_success)} {(SQ <"stash save -u dirty index">)} { (SQ <"\n"> <"\techo 4 > file3 &&\n"> <"\tgit add file3 &&\n"> <"\ttest_tick &&\n"> <"\tgit stash -u\n"> ) } ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(expect)} spids:[228]) (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ("diff --git a/file3 b/file3\n") ("new file mode 100644\n") ("index 0000000..b8626c4\n") ("--- /dev/null\n") ("+++ b/file3\n") ("@@ -0,0 +1 @@\n") ("+4\n") ) } do_expansion: True here_end: EOF was_filled: True spids: [232] ) ] ) (C {(test_expect_success)} {(SQ <"stash save --include-untracked dirty index got stashed">)} { (SQ <"\n"> <"\tgit stash pop --index &&\n"> <"\tgit diff --cached >actual &&\n"> <"\ttest_cmp expect actual\n"> ) } ) (SimpleCommand words: [{(git)} {(reset)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[261])] ) (C {(test_expect_success)} {(SQ <"stash save --include-untracked -q is quiet">)} { (SQ <"\n"> <"\techo 1 > file5 &&\n"> <"\tgit stash save --include-untracked --quiet > .git/stash-output.out 2>&1 &&\n"> <"\ttest_line_count = 0 .git/stash-output.out &&\n"> <"\trm -f .git/stash-output.out\n"> ) } ) (C {(test_expect_success)} {(SQ <"stash save --include-untracked removed files">)} { (SQ <"\n"> <"\trm -f file &&\n"> <"\tgit stash save --include-untracked &&\n"> <"\techo 1 > expect &&\n"> <"\ttest_cmp file expect\n"> ) } ) (C {(rm)} {(-f)} {(expect)}) (C {(test_expect_success)} {(SQ <"stash save --include-untracked removed files got stashed">)} {(SQ <"\n"> <"\tgit stash pop &&\n"> <"\ttest_path_is_missing file\n">)} ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(.gitignore)} spids:[321]) (HereDoc op_id: Redir_DLess fd: -1 body: {(DQ (".gitignore\n") ("ignored\n") ("ignored.d/\n"))} do_expansion: True here_end: EOF was_filled: True spids: [325] ) ] ) (C {(test_expect_success)} {(SQ <"stash save --include-untracked respects .gitignore">)} { (SQ <"\n"> <"\techo ignored > ignored &&\n"> <"\tmkdir ignored.d &&\n"> <"\techo ignored >ignored.d/untracked &&\n"> <"\tgit stash -u &&\n"> <"\ttest -s ignored &&\n"> <"\ttest -s ignored.d/untracked &&\n"> <"\ttest -s .gitignore\n"> ) } ) (C {(test_expect_success)} {(SQ <"stash save -u can stash with only untracked files different">)} { (SQ <"\n"> <"\techo 4 > file4 &&\n"> <"\tgit stash -u &&\n"> <"\ttest_path_is_missing file4\n">) } ) (C {(test_expect_success)} {(SQ <"stash save --all does not respect .gitignore">)} { (SQ <"\n"> <"\tgit stash -a &&\n"> <"\ttest_path_is_missing ignored &&\n"> <"\ttest_path_is_missing ignored.d &&\n"> <"\ttest_path_is_missing .gitignore\n"> ) } ) (C {(test_expect_success)} {(SQ <"stash save --all is stash poppable">)} { (SQ <"\n"> <"\tgit stash pop &&\n"> <"\ttest -s ignored &&\n"> <"\ttest -s ignored.d/untracked &&\n"> <"\ttest -s .gitignore\n"> ) } ) (C {(test_done)}) ] )