forked from gitgutter/Vim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Since we start all external commands by cd'ing to the current file's directory, we can use the file's name instead of its full path. The exception is `git show :FILE` where we must use a path relative to the repo root for maximum git compatibility. It turns out `git rev-parse` takes a `--show-prefix` argument which makes our relative path calculation far simpler. Minimising files paths has these benefits: - Easier to inspect the generated commands. - Less opportunity for escaping problems. - Eliminates possible mismatches betwen absolute paths generated by git and absolute paths generated by Vim (crops up with msys/msys2 on Windows). Thanks to @suxpert for helping with this.
- Loading branch information
Showing
2 changed files
with
22 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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