summaryrefslogtreecommitdiff
path: root/defs/gmake.mk
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-28 13:14:31 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-10-28 13:14:31 +0900
commit179aa26f4fe19ceeb9eceb40e23f7b50d65d1b49 (patch)
treef24e4087deb4c20b6540e3af220ac5b5d520c32e /defs/gmake.mk
parentd8444593774466d835b982c215035d98bc52f3e0 (diff)
Prune stale worktrees before checking out a new pull request [ci skip]
Diffstat (limited to 'defs/gmake.mk')
-rw-r--r--defs/gmake.mk1
1 files changed, 1 insertions, 0 deletions
diff --git a/defs/gmake.mk b/defs/gmake.mk
index e533396bae..dd25897054 100644
--- a/defs/gmake.mk
+++ b/defs/gmake.mk
@@ -233,6 +233,7 @@ define pull-github
$(eval GITHUB_MERGE_BASE := $(shell git -C "$(srcdir)" log -1 --format=format:%H))
$(eval GITHUB_MERGE_BRANCH := $(shell git -C "$(srcdir)" symbolic-ref --short HEAD))
$(eval GITHUB_MERGE_WORKTREE := $(shell mktemp -d "$(srcdir)/gh-$(1)-XXXXXX"))
+ git -C "$(srcdir)" worktree prune
git -C "$(srcdir)" worktree add $(notdir $(GITHUB_MERGE_WORKTREE)) "gh-$(1)"
git -C "$(GITHUB_MERGE_WORKTREE)" rebase $(GITHUB_MERGE_BRANCH)
$(eval COMMIT_GPG_SIGN := $(COMMIT_GPG_SIGN))