git-pivotal-tracker-integration 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af83c4208875d093dba4ab8cd22ea6f157179c41
4
- data.tar.gz: ac6a9da4a881480cceca563859bbfce3016b572f
3
+ metadata.gz: 0ab6418812979b1d65b9e4c9d33a67975836f6c8
4
+ data.tar.gz: 45724b0f38f57772b3aeeac354c9ebebdec5ab5f
5
5
  SHA512:
6
- metadata.gz: 5e6a3d913df8b5c473aa16eb8d624d7e9abec62dd10cf959195f41c68c90b5bb48c253c5aacf858be6d4917705edfc7fbf9b4bc2d40bd5476985b06028f4a92c
7
- data.tar.gz: 8ff57d1fd8e35a4d28803a522612ee77dada8c74ecc1746e5c1d0279e875cec4db3f64b3f4f9fc2695a5ab0b73808e75dabc15ec876eff89d2288e39ce658b49
6
+ metadata.gz: f24d98487c07c4202880bf4bba635b4c6d5dd7e366cf154250653b0a040e5af8ee47024c161b129b89905ad9916d2df0711ad343c4764ef33efd22d2e98e0e8f
7
+ data.tar.gz: a1a44ebbbc319615ca85f75db4bde6a43cd3e3468456e2405ed5984393add4dbc70110f81efb938ebee357c88ca5e15d741b9cde9193f2343c5b2d96548fafc5
@@ -57,7 +57,10 @@ class GitPivotalTrackerIntegration::Command::Start < GitPivotalTrackerIntegratio
57
57
 
58
58
  def start_on_tracker(story)
59
59
  print "Starting story on Pivotal Tracker... "
60
- story.update(:current_state => "started")
60
+ story.update(
61
+ :current_state => "started",
62
+ :owned_by => GitPivotalTrackerIntegration::Util::Git.get_config("user.name")
63
+ )
61
64
  puts "OK"
62
65
  end
63
66
 
@@ -211,17 +211,17 @@ class GitPivotalTrackerIntegration::Util::Git
211
211
  def self.trivial_merge?
212
212
  development_branch = branch_name
213
213
  root_branch = get_config @@KEY_ROOT_BRANCH, :branch
214
- root_remote = get_config @@KEY_ROOT_REMOTE, :branch
215
214
 
216
215
  print "Checking for trivial merge from #{development_branch} to #{root_branch}... "
217
216
 
218
- GitPivotalTrackerIntegration::Util::Shell.exec "git fetch #{root_remote}"
217
+ GitPivotalTrackerIntegration::Util::Shell.exec "git checkout --quiet #{root_branch}"
218
+ GitPivotalTrackerIntegration::Util::Shell.exec "git pull --quiet --ff-only"
219
+ GitPivotalTrackerIntegration::Util::Shell.exec "git checkout --quiet #{development_branch}"
219
220
 
220
- remote_tip = GitPivotalTrackerIntegration::Util::Shell.exec "git rev-parse #{root_remote}/#{root_branch}"
221
- local_tip = GitPivotalTrackerIntegration::Util::Shell.exec "git rev-parse #{root_branch}"
221
+ root_tip = GitPivotalTrackerIntegration::Util::Shell.exec "git rev-parse #{root_branch}"
222
222
  common_ancestor = GitPivotalTrackerIntegration::Util::Shell.exec "git merge-base #{root_branch} #{development_branch}"
223
223
 
224
- if remote_tip != local_tip || local_tip != common_ancestor
224
+ if root_tip != common_ancestor
225
225
  abort "FAIL"
226
226
  end
227
227
 
@@ -43,7 +43,11 @@ describe GitPivotalTrackerIntegration::Command::Start do
43
43
  GitPivotalTrackerIntegration::Util::Git.should_receive(:create_branch).with("12345678-development_branch")
44
44
  GitPivotalTrackerIntegration::Command::Configuration.any_instance.should_receive(:story=)
45
45
  GitPivotalTrackerIntegration::Util::Git.should_receive(:add_hook)
46
- @story.should_receive(:update).with(:current_state => "started")
46
+ GitPivotalTrackerIntegration::Util::Git.should_receive(:get_config).with("user.name").and_return("test_owner")
47
+ @story.should_receive(:update).with(
48
+ :current_state => "started",
49
+ :owned_by => "test_owner"
50
+ )
47
51
 
48
52
  @start.run "test_filter"
49
53
  end
@@ -152,27 +152,13 @@ describe GitPivotalTrackerIntegration::Util::Git do
152
152
  end
153
153
  end
154
154
 
155
- it "should fail if remote tip and local tip do not match" do
155
+ it "should fail if root tip and common_ancestor do not match" do
156
156
  GitPivotalTrackerIntegration::Util::Git.should_receive(:branch_name).and_return("development_branch")
157
157
  GitPivotalTrackerIntegration::Util::Git.should_receive(:get_config).with("root-branch", :branch).and_return("master")
158
- GitPivotalTrackerIntegration::Util::Git.should_receive(:get_config).with("root-remote", :branch).and_return("origin")
159
- GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git fetch origin")
160
- GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git rev-parse origin/master").and_return("remote_tip")
161
- GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git rev-parse master").and_return("local_tip")
162
- GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git merge-base master development_branch").and_return("common_ancestor")
163
-
164
- lambda { GitPivotalTrackerIntegration::Util::Git.trivial_merge? }.should raise_error(SystemExit)
165
-
166
- expect($stderr.string).to match(/FAIL/)
167
- end
168
-
169
- it "should fail if local tip and common ancestor do not match" do
170
- GitPivotalTrackerIntegration::Util::Git.should_receive(:branch_name).and_return("development_branch")
171
- GitPivotalTrackerIntegration::Util::Git.should_receive(:get_config).with("root-branch", :branch).and_return("master")
172
- GitPivotalTrackerIntegration::Util::Git.should_receive(:get_config).with("root-remote", :branch).and_return("origin")
173
- GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git fetch origin")
174
- GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git rev-parse origin/master").and_return("HEAD")
175
- GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git rev-parse master").and_return("HEAD")
158
+ GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git checkout --quiet master")
159
+ GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git pull --quiet --ff-only")
160
+ GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git checkout --quiet development_branch")
161
+ GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git rev-parse master").and_return("root_tip")
176
162
  GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git merge-base master development_branch").and_return("common_ancestor")
177
163
 
178
164
  lambda { GitPivotalTrackerIntegration::Util::Git.trivial_merge? }.should raise_error(SystemExit)
@@ -180,12 +166,12 @@ describe GitPivotalTrackerIntegration::Util::Git do
180
166
  expect($stderr.string).to match(/FAIL/)
181
167
  end
182
168
 
183
- it "should pass if remote tip, local tip, and common ancestor all match" do
169
+ it "should pass if root tip and common ancestor match" do
184
170
  GitPivotalTrackerIntegration::Util::Git.should_receive(:branch_name).and_return("development_branch")
185
171
  GitPivotalTrackerIntegration::Util::Git.should_receive(:get_config).with("root-branch", :branch).and_return("master")
186
- GitPivotalTrackerIntegration::Util::Git.should_receive(:get_config).with("root-remote", :branch).and_return("origin")
187
- GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git fetch origin")
188
- GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git rev-parse origin/master").and_return("HEAD")
172
+ GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git checkout --quiet master")
173
+ GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git pull --quiet --ff-only")
174
+ GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git checkout --quiet development_branch")
189
175
  GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git rev-parse master").and_return("HEAD")
190
176
  GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git merge-base master development_branch").and_return("HEAD")
191
177
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-pivotal-tracker-integration
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Hale