aboutsummaryrefslogtreecommitdiffstats
path: root/defs
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-11 15:42:16 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-11 15:47:39 +0900
commit51d9d0f8887820ce52234c80d78388b002e6e628 (patch)
tree8626b05709820ccba8e73e92f71dbae09e2fd66f /defs
parent1c7eadf75447f10b62e6a93a9c0a90b01bf126e1 (diff)
downloadruby-51d9d0f8887820ce52234c80d78388b002e6e628.tar.gz
Use already fetched pull request [ci skip]
Diffstat (limited to 'defs')
-rw-r--r--defs/gmake.mk5
1 files changed, 4 insertions, 1 deletions
diff --git a/defs/gmake.mk b/defs/gmake.mk
index 358916e32f..2a11d457d6 100644
--- a/defs/gmake.mk
+++ b/defs/gmake.mk
@@ -177,7 +177,10 @@ define fetch-github
git -C "$(srcdir)" remote add github $(GITHUB_RUBY_URL); \
$(eval REMOTE_GITHUB_URL := $(GITHUB_RUBY_URL)) \
)
- git -C "$(srcdir)" fetch -f github "pull/$(1)/head:gh-$(1)"
+ $(if $(git -C "$(srcdir)" log -1 --oneline "github/pull/$(1)/head" 2> /dev/null), \
+ git -C "$(srcdir)" branch -f "gh-$(1)" "github/pull/$(1)/head", \
+ git -C "$(srcdir)" fetch -f github "pull/$(1)/head:gh-$(1)" \
+ )
endef
.PHONY: checkout-github