Correction pour prendre en compte les cas chelous où c'est à jour pas pas de [up to date]
This commit is contained in:
parent
9c881c366e
commit
2184e036a3
1 changed files with 16 additions and 2 deletions
|
@ -45,8 +45,22 @@ 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
|
||||||
if [ -z "$localStatus" ]; then
|
if [ -z "$localStatus" ]; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue