g push/status: use @{upstream} instead of origin
origin won't work if origin/HEAD points to nowhere, which is a valid use-case.
This commit is contained in:
4
g
4
g
@@ -321,11 +321,11 @@ for REPO in $DIRS ; do
|
|||||||
;;
|
;;
|
||||||
push)
|
push)
|
||||||
if [ "$PUSH_ALL" != "1" ] ; then
|
if [ "$PUSH_ALL" != "1" ] ; then
|
||||||
[ -n "$(git rev-list origin..HEAD)" ] || exit 0
|
[ -n "$(git rev-list @{upstream}..HEAD)" ] || exit 0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
LOCALCOMMITS="$(git rev-list origin..HEAD)"
|
LOCALCOMMITS="$(git rev-list @{upstream}..HEAD)"
|
||||||
if [ -z "$LOCALCOMMITS" ] ; then
|
if [ -z "$LOCALCOMMITS" ] ; then
|
||||||
[ -z "$(git diff-index --name-only HEAD --)" ] && exit 0
|
[ -z "$(git diff-index --name-only HEAD --)" ] && exit 0
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user