diff --git a/Perso/INTech/gitUpdate.sh b/Perso/INTech/gitUpdate.sh index 9fb8f76..6e96e64 100755 --- a/Perso/INTech/gitUpdate.sh +++ b/Perso/INTech/gitUpdate.sh @@ -45,8 +45,22 @@ for GIT_REPO in $work_array ; do fi 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=$( if [ -z "$remoteStatus" ]; then if [ -z "$localStatus" ]; then