Ignore exact files within the root directory#947
Open
oliikit wants to merge 5 commits intosobolevn:masterfrom
Open
Ignore exact files within the root directory#947oliikit wants to merge 5 commits intosobolevn:masterfrom
oliikit wants to merge 5 commits intosobolevn:masterfrom
Conversation
Collaborator
|
@oliikit do these changes pass git-secret's self-tests for you? Have not investigated but i'm seeing several test failures on multiple platforms in the auto tests in the github actions. |
Author
|
@joshrabinowitz - I've been meaning to check out the different platform errors. Admittedly, I'm on macOS 12.6 and had passing tests locally. I'm planning on taking a look at the other failed platform tests later this week. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this implement/fix? Explain your changes.
Currently, if a file is a top-level file within a repository and is added to git secret, the filename added to
.gitignorewill subsequently ignore all files with that name in further sub-directories.This can cause some unintended behaviors if you are using git-secret in a mixed repository where there are both encrypted and unencrypted files as any file within sub-directories will be ignored. Adding files to both the
.gitignoreand.git-secret/mapping.cfgutilizegit ls-filesto output the filename and then prepends the path to it in subsequent functions. To fix this issue, if a file is within the root directory (i.e., the path does not contain a/), I prepended a/to the filename so that git ignore works as intended.Does this close any currently open issues?
No
Steps to Reproduce
Current version: git-secret 0.5.0-alpha2
.gitignoreandgit-secretwill beFILENAMEAny other comments?
While this can be fixed by editing the
.gitignorewhenever it causes conflict, this PR just stops the behavior from stopping it in the first place.