File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -77,3 +77,26 @@ setup() {
7777 assert_file_exist " $GITHUB_OUTPUT "
7878 assert_file_contains " $GITHUB_OUTPUT " " commit-url=https://localhost/foo"
7979}
80+
81+ @test " handles untracked files" {
82+ local commit_message=' msg'
83+ local repo=' org/repo'
84+ local branch=' main'
85+ local empty=' false'
86+ local file_pattern=' .'
87+
88+ export GITHUB_OUTPUT=" $BATS_TEST_TMPDIR /github-output"
89+
90+ stub git \
91+ " config --global --add safe.directory $GITHUB_WORKSPACE : echo stubbed" \
92+ " status -s --porcelain=v1 -z -- . : cat ./tests/fixtures/git-status.out-2 | tr '\n' '\0'"
93+
94+ stub ghcommit \
95+ ' -b main -r org/repo -m msg --add=untracked.txt --add=new-file.md --add=modified.txt : echo Success. New commit: https://localhost/bar'
96+
97+ run ./entrypoint.sh " $commit_message " " $repo " " $branch " " $empty " " $file_pattern "
98+ assert_success
99+ assert_output --partial " Success"
100+ assert_file_exist " $GITHUB_OUTPUT "
101+ assert_file_contains " $GITHUB_OUTPUT " " commit-url=https://localhost/bar"
102+ }
You can’t perform that action at this time.
0 commit comments