Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanzweifel committed Apr 10, 2021
1 parent be7095c commit e610a51
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/git-auto-commit.bats
Original file line number Diff line number Diff line change
Expand Up @@ -400,3 +400,37 @@ git_auto_commit() {

assert_equal $current_sha $remote_sha
}

@test "It does not expand wildcard glob when using INPUT_PATTERN in git-status and git-add" {

# Create additional files in a nested directory structure
echo "Create Additional files";
touch "${FAKE_LOCAL_REPOSITORY}"/new-file-a.py
mkdir "${FAKE_LOCAL_REPOSITORY}"/nested
touch "${FAKE_LOCAL_REPOSITORY}"/nested/new-file-b.py

# Commit changes
echo "Commit changes before running git_auto_commit";
cd "${FAKE_LOCAL_REPOSITORY}";
git add . > /dev/null;
git commit --quiet -m "Init Remote Repository";
git push origin master > /dev/null;

# Make nested file dirty
echo "foo-bar" > "${FAKE_LOCAL_REPOSITORY}"/nested/new-file-b.py;

# ---

INPUT_FILE_PATTERN="*.py"

run git_auto_commit

assert_success

assert_line "INPUT_FILE_PATTERN: *.py"
assert_line "::debug::Push commit to remote branch master"

# Assert that py files have not been added.
run git status
refute_output --partial 'nested/new-file-b.py'
}

0 comments on commit e610a51

Please # to comment.