Hide errors on git command

This commit is contained in:
flyingscorpio@arch-desktop 2021-09-09 22:10:26 +02:00
parent 1cdc686fbe
commit 90637538b9

View file

@ -122,7 +122,7 @@ check_unpushed() {
local git_repos=($(find ~ -name .git -type d -not -path '*/.vim/*' -and -not -path '*/.local/*' -and -not -path '*/builds/*' -exec dirname {} \;))
for repo in "${git_repos[@]}"; do
cd "$repo" || exit 1
local unpushed=$(git log --pretty=format:'%h' '@{u}..' | wc -c)
local unpushed=$(git log --pretty=format:'%h' '@{u}..' 2>/dev/null | wc -c)
if [ "$unpushed" -ne 0 ]; then
echo "Unpushed changes in $repo"
fi