mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 07:16:23 -04:00
fix: use array length instead of string length in reset_head
`${#files}` checks the string length of the first element, not the
array length. Use `${#files[@]}` to correctly detect an empty array.
This commit is contained in:
parent
3b9ebce8bc
commit
de5406cdda
|
|
@ -543,7 +543,7 @@ _forgit_reset_head() {
|
|||
while IFS='' read -r file; do
|
||||
files+=("$file")
|
||||
done < <(git diff -z --staged --name-only | tr '\0' '\n' | FZF_DEFAULT_OPTS="$opts" fzf)
|
||||
if [[ ${#files} -eq 0 ]]; then
|
||||
if [[ ${#files[@]} -eq 0 ]]; then
|
||||
echo 'Nothing to unstage.'
|
||||
return 1
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue