Conversation
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.
Description
git_log_fileandgit_log_linecurrently pass the empty string returned bynvim_buf_get_name()for unnamed buffers to Git. Since an empty string is truthy in Lua, both the rename-detection command and the main log command run with an empty pathspec and report command failures.This reads the current buffer name once for file-scoped log pickers and returns an empty finder with a clear warning when the buffer has no file. Repository-wide
git_logbehavior is unchanged.This fixes the validation in the picker source so callers do not need to guard every keymap, as proposed in #2599.
Related Issue(s)
Related to #2599.
Testing
git_log_fileon an unnamed buffer before the changegit_log_fileandgit_log_lineon unnamed andnofilebuffers showCurrent buffer has no filewithout a Git command failureREADME.md)git diff --check