From f6048aa2acaebea86483c05cd872213addabc819 Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Sat, 25 Sep 2021 16:06:43 +0200 Subject: [PATCH] Add Test to Cover #177 refs #177 --- tests/git-auto-commit.bats | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/git-auto-commit.bats b/tests/git-auto-commit.bats index be8806b..654fb7c 100644 --- a/tests/git-auto-commit.bats +++ b/tests/git-auto-commit.bats @@ -477,3 +477,19 @@ git_auto_commit() { run git status refute_output --partial 'nested/new-file-b.py' } + +@test "it does not throw an error if not changes are detected and SKIP_DIRTY_CHECK is false" { + INPUT_FILE_PATTERN="." + INPUT_SKIP_DIRTY_CHECK=false + INPUT_SKIP_FETCH=false + + run git_auto_commit + + assert_success + + assert_line "INPUT_REPOSITORY value: ${INPUT_REPOSITORY}" + assert_line "::set-output name=changes_detected::false" + + run git status + assert_output --partial 'nothing to commit, working tree clean' +}