Skip to content

fix: prevent --literal-pathspecs leaking into git hooks#1893

Open
disrupted wants to merge 1 commit intoNeogitOrg:masterfrom
disrupted:fix-git-hook-literal-pathspecs
Open

fix: prevent --literal-pathspecs leaking into git hooks#1893
disrupted wants to merge 1 commit intoNeogitOrg:masterfrom
disrupted:fix-git-hook-literal-pathspecs

Conversation

@disrupted
Copy link

Neogit currently adds --literal-pathspecs to all git commands, which causes git to export GIT_LITERAL_PATHSPECS=1 to hooks. Hook managers such as hk can fail when running git stash.

e.g. git error:

pathspec ':/' did not match any file(s) known to git

in this case commits abort with Commit failed before the message editor opens.

This change skips --literal-pathspecs for hook-triggering subcommands (commit/merge/rebase/checkout/push), preventing the env leak while keeping the flag for other commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant