From 70446d9112c0d42ca1ab469af07716bb7281169e Mon Sep 17 00:00:00 2001
From: William Roe <git@wjlr.org.uk>
Date: Mon, 27 Mar 2017 11:30:36 +0100
Subject: [PATCH] Add pinned version to outdated output

---
 Library/Homebrew/cmd/outdated.rb           |  4 +++-
 Library/Homebrew/test/cmd/outdated_spec.rb | 16 ++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb
index a18f4e3998..a576162a0f 100644
--- a/Library/Homebrew/cmd/outdated.rb
+++ b/Library/Homebrew/cmd/outdated.rb
@@ -64,7 +64,9 @@ module Homebrew
           "#{full_name} (#{kegs.map(&:version).join(", ")})"
         end.join(", ")
 
-        puts "#{outdated_versions} < #{current_version}"
+        pinned_version = " [pinned at #{f.pinned_version}]" if f.pinned?
+
+        puts "#{outdated_versions} < #{current_version}#{pinned_version}"
       else
         puts f.full_installed_specified_name
       end
diff --git a/Library/Homebrew/test/cmd/outdated_spec.rb b/Library/Homebrew/test/cmd/outdated_spec.rb
index 8e53d84ee3..a7d56efb59 100644
--- a/Library/Homebrew/test/cmd/outdated_spec.rb
+++ b/Library/Homebrew/test/cmd/outdated_spec.rb
@@ -22,4 +22,20 @@ describe "brew outdated", :integration_test do
         .and be_a_success
     end
   end
+
+  context "pinned formula, verbose output" do
+    it "prints out the pinned version" do
+      setup_test_formula "testball"
+      (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
+
+      shutup do
+        expect { brew "pin", "testball" }.to be_a_success
+      end
+
+      expect { brew "outdated", "--verbose" }
+        .to output("testball (0.0.1) < 0.1 [pinned at 0.0.1]\n").to_stdout
+        .and not_to_output.to_stderr
+        .and be_a_success
+    end
+  end
 end
-- 
GitLab