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)
Some git commands require to be run from inside the worktree (as opposed to the git dir, although it's usually in .git). This commit adds a function git_is_worktree to check this. It is used for the commands that need the worktree instead of git_is_repo. An alternative solution might have been to find the git worktree in the parent of the git directory, but this doesn't work for all cases. Generally it's impossible to detect the location of the worktree (plus it's not unique). Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
6 lines
149 B
Fish
6 lines
149 B
Fish
function git_untracked -d "Print list of untracked files"
|
|
git_is_worktree; and begin
|
|
command git ls-files --other --exclude-standard
|
|
end
|
|
end
|