socialcast-git-extensions 3.1.18 → 3.1.19

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: 142609028c21b207ad08dba1ea5deb4c4e6fa7a5
4
- data.tar.gz: 5695fa13f1c2f90ba56232412f83ed94ccb1ea8a
3
+ metadata.gz: bda1a5738f6ce97b652da189f0d18544614f02d4
4
+ data.tar.gz: 4bbf5f6a51edd0e949ec46875c3d83ba8e1a56da
5
5
  SHA512:
6
- metadata.gz: 94e20e9c1c07a4177e149603df027c1c2f597e95fdd088875f697a37b4123f9ef02d658177cd29582acf340134970764a8168a7246d723fa19b4c46d45e0f811
7
- data.tar.gz: 36d9ee894930c6cd47a7bff87ee065ba6f760bf8581287b51c6f903cb76d375db620a7ddf706d97a16cf56a682f23e8b015a9a36e0281d7b498bf2b5776d65db
6
+ metadata.gz: 4603769a42aa207cc13b9b54aa80cc2e1d76697bb89b304659766a138e872661a3baab242b39d81e91a5066f693086d75cd44ebccdb6e51381f80fc9cf6c6f39
7
+ data.tar.gz: 473dcdb7188d4c9f02075a2baffee8e4d6852c3f4f87954c589452e02ad3522392f53c98dd312830cd590beb09f040a7ac1b97e93d8d00551b654356c9ca876c
@@ -10,10 +10,13 @@ module Socialcast
10
10
  end
11
11
 
12
12
  def assert_in_last_known_good_staging(branch)
13
- branches_in_last_known_staging = branches(:remote => true, :merged => "origin/#{last_known_good_staging_branch}")
13
+ refresh_branch_from_remote last_known_good_staging_branch
14
+ branches_in_last_known_staging = branches(:remote => true, :merged => true)
14
15
  unless branches_in_last_known_staging.include? branch
15
16
  raise "Cannot release #{branch} unless it has already been promoted separately to #{staging_branch} and the build has passed."
16
17
  end
18
+ ensure
19
+ run_cmd "git checkout #{branch}"
17
20
  end
18
21
 
19
22
  # lookup the current branch of the PWD
@@ -1,5 +1,5 @@
1
1
  module Socialcast
2
2
  module Gitx
3
- VERSION = "3.1.18"
3
+ VERSION = "3.1.19"
4
4
  end
5
5
  end
data/spec/cli_spec.rb CHANGED
@@ -156,7 +156,7 @@ describe Socialcast::Gitx::CLI do
156
156
  describe '#release' do
157
157
  let(:branches_in_last_known_good_staging) { ['FOO'] }
158
158
  before do
159
- expect_any_instance_of(Socialcast::Gitx::CLI).to receive(:branches).with(:remote => true, :merged => 'origin/last_known_good_staging').and_return(branches_in_last_known_good_staging)
159
+ expect_any_instance_of(Socialcast::Gitx::CLI).to receive(:branches).with(:remote => true, :merged => true).and_return(branches_in_last_known_good_staging)
160
160
  end
161
161
 
162
162
  context 'when user rejects release' do
@@ -164,8 +164,8 @@ describe Socialcast::Gitx::CLI do
164
164
  expect_any_instance_of(Socialcast::Gitx::CLI).to receive(:yes?).and_return(false)
165
165
  Socialcast::Gitx::CLI.start ['release']
166
166
  end
167
- it 'should run no commands' do
168
- expect(Socialcast::Gitx::CLI.stubbed_executed_commands).to eq([])
167
+ it 'does not try and release the branch' do
168
+ expect(Socialcast::Gitx::CLI.stubbed_executed_commands).to eq(["git branch -D last_known_good_staging", "git fetch origin", "git checkout last_known_good_staging", "git checkout FOO"])
169
169
  end
170
170
  end
171
171
  context 'when user confirms release' do
@@ -179,6 +179,10 @@ describe Socialcast::Gitx::CLI do
179
179
  it 'should post message to socialcast' do end # see expectations
180
180
  it 'should run expected commands' do
181
181
  expect(Socialcast::Gitx::CLI.stubbed_executed_commands).to eq([
182
+ "git branch -D last_known_good_staging",
183
+ "git fetch origin",
184
+ "git checkout last_known_good_staging",
185
+ "git checkout FOO",
182
186
  "git pull origin FOO",
183
187
  "git pull origin master",
184
188
  "git push origin HEAD",
@@ -235,6 +239,10 @@ describe Socialcast::Gitx::CLI do
235
239
  end
236
240
  it 'should run expected commands' do
237
241
  expect(Socialcast::Gitx::CLI.stubbed_executed_commands).to eq([
242
+ "git branch -D last_known_good_staging",
243
+ "git fetch origin",
244
+ "git checkout last_known_good_staging",
245
+ "git checkout FOO",
238
246
  "git pull origin FOO",
239
247
  "git pull origin special-master",
240
248
  "git push origin HEAD",
@@ -271,6 +279,10 @@ describe Socialcast::Gitx::CLI do
271
279
  it 'should post message to socialcast' do end # see expectations
272
280
  it 'should run expected commands' do
273
281
  expect(Socialcast::Gitx::CLI.stubbed_executed_commands).to eq([
282
+ "git branch -D last_known_good_staging",
283
+ "git fetch origin",
284
+ "git checkout last_known_good_staging",
285
+ "git checkout FOO",
274
286
  "git pull origin FOO",
275
287
  "git pull origin special-master",
276
288
  "git push origin HEAD",
@@ -308,6 +320,10 @@ describe Socialcast::Gitx::CLI do
308
320
  it 'should post message to socialcast' do end # see expectations
309
321
  it 'should run expected commands' do
310
322
  expect(Socialcast::Gitx::CLI.stubbed_executed_commands).to eq([
323
+ "git branch -D last_known_good_staging",
324
+ "git fetch origin",
325
+ "git checkout last_known_good_staging",
326
+ "git checkout FOO",
311
327
  "git pull origin FOO",
312
328
  "git pull origin special-master",
313
329
  "git push origin HEAD",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socialcast-git-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.18
4
+ version: 3.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Sonnek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-19 00:00:00.000000000 Z
11
+ date: 2014-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grit