Skip to content

Commit

Permalink
refactor: remove -u option from git status in forgit add
Browse files Browse the repository at this point in the history
Signed-off-by: Wenxuan Zhang <[email protected]>
  • Loading branch information
wfxr committed Aug 14, 2024
1 parent 17394d1 commit dad03c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/git-forgit
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ _forgit_add() {
_forgit_inside_work_tree || return 1
local changed unmerged untracked files opts
# Add files if passed as arguments
[[ $# -ne 0 ]] && { _forgit_git_add "$@" && git status -su; return $?; }
[[ $# -ne 0 ]] && { _forgit_git_add "$@" && git status -s; return $?; }

changed=$(git config --get-color color.status.changed red)
unmerged=$(git config --get-color color.status.unmerged red)
Expand All @@ -368,7 +368,7 @@ _forgit_add() {
sed -E 's/^(..[^[:space:]]*)[[:space:]]+(.*)$/[\1] \2/' |
FZF_DEFAULT_OPTS="$opts" fzf |
_forgit_get_single_file_from_add_line)
[[ "${#files[@]}" -gt 0 ]] && _forgit_git_add "${files[@]}" && git status -su && return
[[ "${#files[@]}" -gt 0 ]] && _forgit_git_add "${files[@]}" && git status -s && return
echo 'Nothing to add.'
}

Expand Down

0 comments on commit dad03c3

Please sign in to comment.