From e7b65c62a0b631f798b56e7713965807b833e3c5 Mon Sep 17 00:00:00 2001
From: Jonathan Chang <me@jonathanchang.org>
Date: Mon, 12 Oct 2020 21:31:12 +1100
Subject: [PATCH] pr-pull: clean up review signoff trailer code

---
 Library/Homebrew/dev-cmd/pr-pull.rb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb
index 3effc9eaa2..c849f4a94b 100644
--- a/Library/Homebrew/dev-cmd/pr-pull.rb
+++ b/Library/Homebrew/dev-cmd/pr-pull.rb
@@ -104,9 +104,10 @@ module Homebrew
     if pr
       # This is a tap pull request and approving reviewers should also sign-off.
       tap = Tap.from_path(path)
-      trailers += GitHub.approved_reviews(tap.user, tap.full_name.split("/").last, pr).map do |r|
+      review_trailers = GitHub.approved_reviews(tap.user, tap.full_name.split("/").last, pr).map do |r|
         "Signed-off-by: #{r["name"]} <#{r["email"]}>"
-      end.join("\n")
+      end
+      trailers = trailers.lines.concat(review_trailers).map(&:strip).uniq.join("\n")
 
       # Append the close message as well, unless the commit body already includes it.
       close_message = "Closes ##{pr}."
-- 
GitLab