Skip to content

Commit

Permalink
commit: Do not print error message on zero untracked files
Browse files Browse the repository at this point in the history
  • Loading branch information
rffontenelle authored Sep 6, 2024
1 parent 3198721 commit e0c78fa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ git status -s | grep '^ D ' | cut -d' ' -f3 | xargs -r git rm
git diff -I'^"POT-Creation-Date: ' --numstat *.po **/*.po | cut -f3 | xargs -r git add -v

# Add currently untracked PO files, and update other helper files
git add -v $(git ls-files -o --exclude-standard *.po **/*.po)
untracked_files=$(git ls-files -o --exclude-standard *.po **/*.po)
if [ -n "${untracked_files+x}" ]; then
git add -v $untracked_files
fi

# Commit only if there is any cached file
git diff-index --cached --quiet HEAD || { git add -v $extra_files; git commit -vm "Update translations"; }

0 comments on commit e0c78fa

Please sign in to comment.