pullrebase: skip rebase if current branch is up-to-date

Any attempt at rebasing is unnecessary when the current branch is
up-to-date with the remote, so skip the rebase in this case.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit is contained in:
Patrick McCarty
2019-07-17 12:54:04 -07:00
parent 2465219907
commit 3b1e4e5558

View File

@@ -143,6 +143,10 @@ pullrebase:
echo "No commits exist in remote. Continuing."; \
exit 0; \
fi; \
if [ "$$(git rev-list FETCH_HEAD | head -n 1)" = "$$(git rev-list HEAD | head -n 1)" ]; then \
echo "Current branch up-to-date. Continuing."; \
exit 0; \
fi; \
echo "Rebasing to origin/master"; \
if git status --porcelain | grep -q '^.[^?]'; \
then \