with_git_repo 0.2.0 → 0.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: 2e83d3737e76f22e54646fa0abae70e006e7d3a8
4
- data.tar.gz: 89c4664067f44734d5fca279fd2b41b7da340929
3
+ metadata.gz: 11404482fd0e815e170d7d4500f30c0f6dda2d4f
4
+ data.tar.gz: fd5497b42a2862e5531e4a7a3191919472d93fa8
5
5
  SHA512:
6
- metadata.gz: 704de5a550e220d45ea3b3f6f409f6d2f23d6634ff63c434ced010c0b9d682d61ce4fb7d8bbdeb909c8be5ba8e5c8272a91da9f2ed41bedf240d2125915c2d6b
7
- data.tar.gz: 721997dec2b780f15fa9dd50cf9a9ae17241e8b7b6a8c4fc5185c1936f784b3697f56a8d73d90de0740de85c9905256fe2defbccf6139c1af3d005b2bc78541a
6
+ metadata.gz: 31fcfa61332363257054317fcdf8baa10bc6982b98d766edd08c87b41620c7b503d698a99cb1a2a6737c773f8fd1766d114d23e24152b64b4b1a3d30d4d83883
7
+ data.tar.gz: 55ed2e9772cb8dbc0da2f75f2b98bc2bcebe0f1e78b898ef7fa996283c61c20dba99b855287da2bed33a78ea44bd9fa171fb407434cfb5823fe9cbce3d74eed2
@@ -13,11 +13,7 @@ class WithGitRepo
13
13
  end
14
14
 
15
15
  def commit_changes_to_branch(branch, message)
16
- if git.branches["origin/#{branch}"]
17
- git.checkout(branch)
18
- else
19
- git.checkout(branch, new_branch: true)
20
- end
16
+ checkout_branch!(branch)
21
17
  git.chdir { yield }
22
18
  git.add
23
19
  return unless git.status.changed.any? || git.status.added.any?
@@ -27,8 +23,8 @@ class WithGitRepo
27
23
 
28
24
  private
29
25
 
30
- def checkout_branch(branch)
31
- if git.branches["origin/#{branch}"]
26
+ def checkout_branch!(branch)
27
+ if git.branches[branch] || git.branches["origin/#{branch}"]
32
28
  git.checkout(branch)
33
29
  else
34
30
  git.checkout(branch, new_branch: true)
@@ -1,3 +1,3 @@
1
1
  class WithGitRepo
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: with_git_repo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Mytton
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-09 00:00:00.000000000 Z
11
+ date: 2016-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git