git-pivotal-tracker-integration 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ab6418812979b1d65b9e4c9d33a67975836f6c8
|
4
|
+
data.tar.gz: 45724b0f38f57772b3aeeac354c9ebebdec5ab5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
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
|
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
|
-
|
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
|
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
|
-
|
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
|
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::
|
159
|
-
GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git
|
160
|
-
GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git
|
161
|
-
GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git rev-parse master").and_return("
|
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
|
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::
|
187
|
-
GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git
|
188
|
-
GitPivotalTrackerIntegration::Util::Shell.should_receive(:exec).with("git
|
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
|
|