git_pivotal_tracker 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/git_pivotal_tracker/finish.rb +2 -1
- data/lib/git_pivotal_tracker/story.rb +6 -3
- data/lib/git_pivotal_tracker/version.rb +1 -1
- data/spec/fixtures/finish_story.xml +1 -1
- data/spec/fixtures/one_story.xml +1 -1
- data/spec/fixtures/start_story.xml +1 -1
- data/spec/fixtures/story.xml +1 -1
- data/spec/git_pivotal_tracker/finish_spec.rb +2 -2
- metadata +2 -2
@@ -11,8 +11,9 @@ module GitPivotalTracker
|
|
11
11
|
|
12
12
|
if options[:rebase]
|
13
13
|
puts "Fetching origin and rebasing #{current_branch}"
|
14
|
+
log repository.git.checkout({:raise => true}, integration_branch)
|
14
15
|
log repository.git.pull({:raise => true})
|
15
|
-
log repository.git.rebase({:raise => true}, integration_branch)
|
16
|
+
log repository.git.rebase({:raise => true}, integration_branch, current_branch)
|
16
17
|
end
|
17
18
|
|
18
19
|
puts "Merging #{current_branch} into #{integration_branch}"
|
@@ -14,10 +14,9 @@ module GitPivotalTracker
|
|
14
14
|
puts "URL: #{story.url}"
|
15
15
|
puts "Story: #{story.name}"
|
16
16
|
|
17
|
-
|
18
|
-
print "Enter branch name [#{default_suffix}]: "
|
17
|
+
print "Enter branch name [#{branch_suffix story}]: "
|
19
18
|
suffix = gets.chomp
|
20
|
-
suffix =
|
19
|
+
suffix = branch_suffix(story) if suffix == ""
|
21
20
|
|
22
21
|
branch = "#{story.story_type}-#{story.id}-#{suffix}"
|
23
22
|
puts "Checking out a new branch '#{branch}'"
|
@@ -44,6 +43,10 @@ module GitPivotalTracker
|
|
44
43
|
conditions[:story_type] = type unless type == 'story'
|
45
44
|
project.stories.all(conditions).first
|
46
45
|
end
|
46
|
+
|
47
|
+
def branch_suffix(story)
|
48
|
+
story.name.sub(/^\W+/, '').sub(/\W+$/, '').gsub(/\W+/, '_').downcase
|
49
|
+
end
|
47
50
|
end
|
48
51
|
|
49
52
|
class Bug < Story; end
|
data/spec/fixtures/one_story.xml
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
<description>As a moderator,
|
11
11
|
I can pause the film
|
12
12
|
In order to allow another activity to take place (discussion, etc).</description>
|
13
|
-
<name>Pause the film
|
13
|
+
<name> Pause the film!</name>
|
14
14
|
<requested_by>Ben Lindsey</requested_by>
|
15
15
|
<created_at type="datetime">2011/07/14 23:06:28 UTC</created_at>
|
16
16
|
<updated_at type="datetime">2011/07/14 23:13:24 UTC</updated_at>
|
data/spec/fixtures/story.xml
CHANGED
@@ -53,7 +53,7 @@ describe GitPivotalTracker::Finish do
|
|
53
53
|
|
54
54
|
it "merges the topic branch into the integration branch with a merge commit" do
|
55
55
|
finish.run!.should == 0
|
56
|
-
@repo.head.name.should == @current_head.
|
56
|
+
@repo.head.name.should == @current_head.name
|
57
57
|
@repo.commits.first.parents.should have(2).items
|
58
58
|
@repo.heads.detect { |h| h.name == @current_head.name }.commit.sha.should == @sha
|
59
59
|
end
|
@@ -62,7 +62,7 @@ describe GitPivotalTracker::Finish do
|
|
62
62
|
before do
|
63
63
|
finish.options[:rebase] = 1
|
64
64
|
finish.repository.git.should_receive(:pull).with(:raise => true)
|
65
|
-
finish.repository.git.should_receive(:rebase).with({:raise => true}, @current_head.name)
|
65
|
+
finish.repository.git.should_receive(:rebase).with({:raise => true}, @current_head.name, @new_branch)
|
66
66
|
end
|
67
67
|
|
68
68
|
it "succeeds" do
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: git_pivotal_tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ben Lindsey
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-07-
|
13
|
+
date: 2011-07-21 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|