f-person / git-blame.nvim

Git Blame plugin for Neovim written in Lua
GNU General Public License v3.0
839 stars 41 forks source link

fix: add fallbacks for url commands #125

Closed bossley9 closed 4 months ago

bossley9 commented 4 months ago

Problem

While investigating https://github.com/f-person/git-blame.nvim/issues/117 I noticed that the urls generated by GitBlameOpenCommitURL, GitBlameOpenFileURL, GitBlameCopyCommitURL, and GitBlameCopyFileURL can sometimes have incorrect fallback values when used outside of a git repository. I fixed these commands so that the provide a reasonable fallback value or log to the command output.

Verification

Run the commands above and verify they provide a reasonable output for git repositories and other non-repository directories!