From 3b1e4e5558bbb98a338e9ff280a7fc01a495e5fa Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Wed, 17 Jul 2019 12:54:04 -0700 Subject: [PATCH] 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 --- Makefile.common | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile.common b/Makefile.common index 4c9fe52..c95a98f 100644 --- a/Makefile.common +++ b/Makefile.common @@ -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 \