1
0
Fork 0

Correction pour prendre en compte les cas chelous où c'est à jour pas pas de [up to date]

This commit is contained in:
trotFunky 2019-05-20 23:36:42 +02:00
parent 9c881c366e
commit 2184e036a3

View file

@ -45,7 +45,21 @@ for GIT_REPO in $work_array ; do
fi fi
remoteStatus="$(git fetch --dry-run 2>&1 | tail -n 1 | grep -v -e'+')" # Empty if there are no commits to fetch remoteStatus="$(git fetch --dry-run 2>&1 | tail -n 1 | grep -v -e'+')" # Empty if there are no commits to fetch
localStatus="$(git push -n --porcelain | grep -e'up to date')" # Empty if there are commits to push
refChanges=$(git push -n --porcelain | grep -e'refs')
nbRefs=$(echo "$refChanges" | wc -l)
nbNonPushRefs=$(echo $(echo "$refChanges" | cut -f1) | wc -w)
localStatus="Nothing to do" # Empty if there are commits to push
if [ ! -z $(echo $refChanges | grep -e"*") ]; then
localStatus=""
fi
if [ ! $nbRefs -eq $nbNonPushRefs ]; then
localStatus=""
fi
output=$( output=$(
if [ -z "$remoteStatus" ]; then if [ -z "$remoteStatus" ]; then