Created
December 9, 2016 20:36
-
-
Save colstrom/f31c99a55f80015537d9e397a96b9427 to your computer and use it in GitHub Desktop.
directory-in-git.fish: check if a directory is or is in a git repository
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
| function directory-in-git --argument dir | |
| git -C "$dir" rev-parse --is-inside-working-tree >/dev/null ^/dev/null | |
| status-to-bool $status | |
| end |
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
| name = directory-in-git | |
| author = Chris Olstrom | |
| license = MIT | |
| provides = fish/functions/directory-in-git | |
| requires | |
| command/git | |
| fish/builtin/end | |
| fish/builtin/function | |
| fish/functions/status-to-bool |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment