From 4910ef088203c49fc497330e927feed03b98b5a1 Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Mon, 14 May 2018 11:49:26 -0700 Subject: [PATCH] koji: only pull --rebase if remote is initialized After running 'make autospecnew', the freshly created repo only exists locally, so the repo remote is not yet initialized. The 'git pull --rebase' (via 'make koji') will then fail due to the uninitialized remote. Improve this case by only rebasing when the remote is initialized. Signed-off-by: Patrick McCarty --- Makefile.common | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.common b/Makefile.common index 4b98819..dea2245 100644 --- a/Makefile.common +++ b/Makefile.common @@ -286,8 +286,10 @@ koji: prekoji-checks kojidef @if ! git branch | grep -q -E '^\* master'; then \ echo "Error: Must be on the master branch to submit to koji" >&2; \ exit 1; \ + fi; \ + if git rev-parse --verify --quiet origin/master > /dev/null; then \ + git pull --rebase; \ fi - git pull --rebase git tag $(SRPMVERS) git push origin master refs/tags/$(SRPMVERS) $(KOJI_CMD) build $$KOJI_NOWAIT $(KOJI_TAG) $(PKG_BASE_URL)/$(PKG_NAME)?#$(SRPMVERS)