From 430f03338145340d537b3218bf0b6d651d9dc19c Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 23 May 2022 11:17:47 +0100 Subject: [PATCH] Create forward port issues for merges into main This reverts commit 4e884b27f874ff210d0435fca176c75eff38b166. Closes gh-31148 --- git/hooks/prepare-forward-merge | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/git/hooks/prepare-forward-merge b/git/hooks/prepare-forward-merge index 7cbdf21e9e..76b308e3cb 100755 --- a/git/hooks/prepare-forward-merge +++ b/git/hooks/prepare-forward-merge @@ -27,7 +27,7 @@ end def rewrite_message(message_file, fixed) current_branch = `git rev-parse --abbrev-ref HEAD`.strip if current_branch == "main" - return nil + current_branch = $main_branch end rewritten_message = "" message = File.read(message_file) @@ -68,6 +68,4 @@ end $log.debug "Searching for for forward merge" fixed = get_fixed_issues() rewritten_message = rewrite_message(message_file, fixed) -unless rewritten_message.nil? - File.write(message_file, rewritten_message) -end +File.write(message_file, rewritten_message)