<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>vendor/capture_fu.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -2,6 +2,10 @@ require 'rubygems'
 require 'colored'
 
 grb_app_root = File.expand_path( File.dirname(__FILE__) + '/..' )
+
+$LOAD_PATH.unshift( grb_app_root + '/vendor' )
+require 'capture_fu'
+
 $LOAD_PATH.unshift( grb_app_root + '/lib' )
 require 'param_reader'
 require 'version'</diff>
      <filename>lib/git_remote_branch.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,6 @@
 module GitRemoteBranch
+  include ::CaptureFu
+  
   private 
   HELP_PARAMS = {:action =&gt; :help}
 
@@ -24,7 +26,7 @@ module GitRemoteBranch
       p[:branch] ||= &quot;branch_to_#{p[:action]}&quot;
       p[:current_branch] = begin
         get_current_branch
-      rescue 
+      rescue NotOnGitRepositoryError, InvalidBranchError
         'current_branch'
       end
 
@@ -61,18 +63,22 @@ module GitRemoteBranch
   end
 
   private
-  BRANCH_LISTING_COMMAND = 'git branch -l'.freeze
+    BRANCH_LISTING_COMMAND = 'git branch -l'.freeze
   
   public
-  def get_current_branch
-    #This is sensitive to checkouts of branches specified with wrong case
-    
-    x = `#{BRANCH_LISTING_COMMAND}`
-    x.each_line do |l|
-      return l.sub(&quot;*&quot;,&quot;&quot;).strip if l =~ /\A\*/ and not l =~ /\(no branch\)/
+    def get_current_branch
+      #This is sensitive to checkouts of branches specified with wrong case
+      
+      listing = capture_process_output(&quot;#{BRANCH_LISTING_COMMAND}&quot;)[1]
+      raise(NotOnGitRepositoryError, listing.chomp) if listing =~ /Not a git repository/i
+      
+      current_branch = listing.scan(/^\*\s+(.+)/).flatten.first
+      
+      if current_branch =~ /\(no branch\)/
+        raise InvalidBranchError, [&quot;Couldn't identify the current local branch. The branch listing was:&quot;,
+          BRANCH_LISTING_COMMAND.red, 
+          listing].join(&quot;\n&quot;)
+      end
+      current_branch.strip
     end
-    raise InvalidBranchError, [&quot;Couldn't identify the current local branch. The branch listing was:&quot;,
-      BRANCH_LISTING_COMMAND.red, 
-      x].join(&quot;\n&quot;)
-  end
 end</diff>
      <filename>lib/param_reader.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,3 +5,14 @@ Rake::TestTask.new(:test) do |t|
   t.verbose = true
 end
 
+namespace :test do
+  Rake::TestTask.new(:functional) do |t|
+    t.pattern = 'test/functional/**/*_test.rb'
+    t.verbose = true
+  end
+
+  Rake::TestTask.new(:unit) do |t|
+    t.pattern = 'test/unit/**/*_test.rb'
+    t.verbose = true
+  end
+end</diff>
      <filename>tasks/test.rake</filename>
    </modified>
    <modified>
      <diff>@@ -14,10 +14,10 @@ require 'redgreen' unless IN_TM
 
 require 'ruby-debug'
 
-Dir[test_dir+'/helpers/**/*.rb'].each{|f| require f} 
-
 require File.join( [test_dir] + %w{ .. lib git_remote_branch} )
 
+Dir[test_dir+'/helpers/**/*.rb'].each{|f| require f} 
+
 class Test::Unit::TestCase
   include MoreAssertions
 </diff>
      <filename>test/test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>test/helpers/capture_fu.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>fdff8b5e4ca4fac84ba804690fabbbbf88bb9601</id>
    </parent>
  </parents>
  <author>
    <name>Mathieu Martin</name>
    <email>webmat@gmail.com</email>
  </author>
  <url>http://github.com/webmat/git_remote_branch/commit/f8f7200ff9ad98ae59ed2360a96ec8b6c605d0af</url>
  <id>f8f7200ff9ad98ae59ed2360a96ec8b6c605d0af</id>
  <committed-date>2008-08-05T12:07:23-07:00</committed-date>
  <authored-date>2008-08-05T12:07:23-07:00</authored-date>
  <message>now using CaptureFu (vendored) for main git remote branch functionality</message>
  <tree>f3a2b2c889a53d9212189637385a727e3981f986</tree>
  <committer>
    <name>Mathieu Martin</name>
    <email>webmat@gmail.com</email>
  </committer>
</commit>
