<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -54,3 +54,17 @@ Feature: Import remote repository into a Git repository
     Then I should see a successful import message from Piston
     And I should find a vendor/libcalc folder
     And I should find a vendor/libcalc/libcalc.rb file
+
+  Scenario: Import from a branch
+    Given a newly created Git project
+    And a remote Git project named rails
+    And a file named rails.rb with content &quot;a\n&quot; in remote rails project
+    And a branch on the rails project named &quot;2-3-stable&quot;
+    And a file named 2-3-README with content &quot;Rails 2.3\n&quot; in remote rails project
+    When I import the &quot;2-3-stable&quot; branch of rails
+    Then I should see &quot;2-3-stable&quot;
+    And I should see a successful import message from Piston
+    And I should find a rails folder
+    And I should find a rails/rails.rb file
+    And I should find a rails/2-3-README file
+    And I should find a rails/.piston.yml file</diff>
      <filename>features/import_to_git.feature</filename>
    </modified>
    <modified>
      <diff>@@ -211,3 +211,25 @@ Then /^I should see a successful update message from Piston$/ do
     @stdout.should =~ /Updated .*\/libcalc to revision \d+/
   end
 end
+
+Given /^a branch on the ([^ ]+) project named &quot;([^\&quot;]*)&quot;$/ do |project, branch|
+  Dir.chdir(@remotewcdir) do
+    if (@remotewcdir + &quot;.git&quot;).directory? then
+      git :checkout, &quot;-b&quot;, branch
+			@stdout = git :branch
+      @stdout.should =~ /^\*\s+#{branch}/
+    else
+			pending
+    end
+  end
+end
+
+When /^I import the &quot;([^\&quot;]+)&quot; branch of ([^ ]+)(?: into ([\w\/]+))?$/ do |branch, project, into|
+  Dir.chdir(@wcdir) do
+    cmd = &quot;#{Tmpdir.piston} import --verbose 5 --commit #{branch} file://#{@remotereposdir} 2&gt;&amp;1&quot;
+    cmd &lt;&lt; &quot; #{into}&quot; if into
+    STDERR.puts cmd.inspect if $DEBUG
+    @stdout = `#{cmd}`
+    STDERR.puts @stdout if $DEBUG
+  end
+end</diff>
      <filename>features/step_definitions/repository.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,6 +14,7 @@ module Piston
       def initialize(repository, revision, recalled_values={})
         super
         @revision = 'master' if @revision.upcase == 'HEAD'
+        @revision = &quot;origin/#{@revision}&quot; unless @revision.include?(&quot;/&quot;)
       end
 
       def client</diff>
      <filename>lib/piston/git/commit.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>508fb8092ff684db62b19120dee49bd9cbca0447</id>
    </parent>
  </parents>
  <author>
    <name>Fran&#231;ois Beausoleil</name>
    <email>francois@teksol.info</email>
  </author>
  <url>http://github.com/francois/piston/commit/f11983eb62bbc119329e18e6f51ffefdff149051</url>
  <id>f11983eb62bbc119329e18e6f51ffefdff149051</id>
  <committed-date>2009-07-20T07:50:38-07:00</committed-date>
  <authored-date>2009-07-20T07:17:49-07:00</authored-date>
  <message>When checking out a branch from Git, specify the remote so we work with more version of Git.

http://groups.google.com/group/piston-discussion/browse_thread/thread/57560bd1963a9c48</message>
  <tree>f4984617f33b6d5a4f46bec6223467a8f294aa2b</tree>
  <committer>
    <name>Fran&#231;ois Beausoleil</name>
    <email>francois@teksol.info</email>
  </committer>
</commit>
