Skip to content

Tartufo pre-commit command does not scan files committed via git commit -am command #412

Open
@jwinders-godaddy

Description

@jwinders-godaddy

🐛 Bug Report

To Reproduce

Using tartufo 3.2.1 or 3.3.1

Following steps assume a local .pre-commit-config.yaml file with the following content:

repos:
- repo: https://github.com/godaddy/tartufo
  rev: v3.3.1
  hooks:
  - id: tartufo
mkdir tartufo-pre-commit-test
cd tartufo-pre-commit-test/
git init
touch test_file
git status
git add .
git commit
pre-commit install
cat test_file # file is empty
openssl rand -base64 40 > test_file # add some content that tartufo would flag
git commit -am "test" # this should result in tartufo complaining about the content, but with issue shows passing scan

Expected Behavior

Tartufo:pre-commit should scan files not explicitly staged via git add, but added via git commit -am
report issue.

Perhaps additionally, the command should indicate when there are no files being operated on by the command.

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions