Former-commit-id: fa3303b432
This commit is contained in:
Wenxuan Zhang 2020-01-14 22:36:52 +08:00
parent e73cef6856
commit b5ef8632e2
2 changed files with 3 additions and 9 deletions

View file

@ -77,10 +77,7 @@ end
function forgit::add
forgit::inside_work_tree || return 1
# Add files if passed as arguments
if not count $argv > /dev/null
git add $argv
return
end
count $argv >/dev/null && git add "$argv" && return
set changed (git config --get-color color.status.changed red)
set unmerged (git config --get-color color.status.unmerged red)

View file

@ -51,13 +51,10 @@ forgit::diff() {
# git add selector
forgit::add() {
forgit::inside_work_tree || return 1
local changed unmerged untracked files opts
# Add files if passed as arguments
[[ $# -ne 0 ]] && {
git add $@
return
}
[[ $# -ne 0 ]] && git add "$@" && return
local changed unmerged untracked files opts
changed=$(git config --get-color color.status.changed red)
unmerged=$(git config --get-color color.status.unmerged red)
untracked=$(git config --get-color color.status.untracked red)