1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Prune stale worktrees before checking out a new pull request [ci skip]

This commit is contained in:
Nobuyoshi Nakada 2021-10-28 13:14:31 +09:00
parent d844459377
commit 179aa26f4f
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -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))