mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-02-15 01:24:28 +08:00
![Johannes Altmanninger](/assets/img/avatar_default.png)
For example, "git diff" would print "fatal: this operation must be run in a work tree" We could still run git_branch_name in bare repositories in future.
8 lines
210 B
Fish
8 lines
210 B
Fish
function git_is_repo -d "Check if directory is a repository"
|
|
test -d .git
|
|
or begin
|
|
set -l info (command git rev-parse --git-dir --is-bare-repository 2>/dev/null)
|
|
and test $info[2] = false
|
|
end
|
|
end
|