thegarage-gitx 2.4.0 → 2.4.1

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: a1ab3df33daeff39133b9a20762d4ba94b5b857e
4
- data.tar.gz: 7ea13bc4808220392044c53a7be1ce0f1ba8c4a7
3
+ metadata.gz: 4b6f8520b6fa00eb4d8b5bd41b2d299e82391e2d
4
+ data.tar.gz: a4ed62c3ae3a6fe20e01751690ceb441a9347a71
5
5
  SHA512:
6
- metadata.gz: 569761fcf3d90042b470592bbc82dfb2b82c08e758ed5aa9d5dd49aa454b95f7fa87bab51d3ec943bf5f425d5123bd8e56e25c4bd6f2b8430046cedcac931c60
7
- data.tar.gz: d4ed23efd5342cac379163240fbf7dd9feb550b1c68e97151bb9ff64cab2ce426d9df89616ae450a3d5a20c9ce2da57ab3470c8a64977033e2629d2f87606ff7
6
+ metadata.gz: 64bc132adcc7aa7ea0fd72a7d5b3070f74a53619f8b73bcc4e4f4697c6dab65b1410fef999d2f03bbb9dd355810576c6ea75e6e8d48f7c7989e24cba8f568644
7
+ data.tar.gz: 73960b3ec6ad32a0435a3f2e5c3bc1656a9628c057fd7c5a2e583920785e991532832a4db03aa02c2b4cfc9d3781f97da91cb1721e6a668c946269c86f679f8a
@@ -24,12 +24,14 @@ module Thegarage
24
24
  private
25
25
 
26
26
  def valid_new_branch_name?(branch)
27
- return false if remote_branches.include?(branch)
27
+ return false if repo_branches.include?(branch)
28
28
  branch =~ VALID_BRANCH_NAME_REGEX
29
29
  end
30
30
 
31
- def remote_branches
32
- @remote_branches ||= repo.branches.each_name(:remote).to_a.map { |branch| branch.split('/').last }
31
+ def repo_branches
32
+ @branch_names ||= repo.branches.each_name.map do |branch|
33
+ branch.split('/').last
34
+ end
33
35
  end
34
36
  end
35
37
  end
@@ -1,5 +1,5 @@
1
1
  module Thegarage
2
2
  module Gitx
3
- VERSION = '2.4.0'
3
+ VERSION = '2.4.1'
4
4
  end
5
5
  end
@@ -56,8 +56,29 @@ describe Thegarage::Gitx::Cli::StartCommand do
56
56
  should meet_expectations
57
57
  end
58
58
  end
59
+ context 'when branch already exists in local repo' do
60
+ let(:branches) { double(each_name: ['bar']) }
61
+ before do
62
+ expect(repo).to receive(:branches).and_return(branches)
63
+
64
+ expect(cli).to receive(:ask).and_return('new-branch')
65
+
66
+ expect(cli).to receive(:checkout_branch).with('master').ordered
67
+ expect(cli).to receive(:run_cmd).with('git pull').ordered
68
+ expect(repo).to receive(:create_branch).with('new-branch', 'master').ordered
69
+ expect(cli).to receive(:checkout_branch).with('new-branch').ordered
70
+
71
+ cli.start 'bar'
72
+ end
73
+ it 'prompts user to enter a new branch name' do
74
+ should meet_expectations
75
+ end
76
+ end
59
77
  context 'when branch already exists in remote repo' do
78
+ let(:branches) { double(each_name: ['origin/bar']) }
60
79
  before do
80
+ expect(repo).to receive(:branches).and_return(branches)
81
+
61
82
  expect(cli).to receive(:ask).and_return('new-branch')
62
83
 
63
84
  expect(cli).to receive(:checkout_branch).with('master').ordered
@@ -65,7 +86,7 @@ describe Thegarage::Gitx::Cli::StartCommand do
65
86
  expect(repo).to receive(:create_branch).with('new-branch', 'master').ordered
66
87
  expect(cli).to receive(:checkout_branch).with('new-branch').ordered
67
88
 
68
- cli.start 'master'
89
+ cli.start 'bar'
69
90
  end
70
91
  it 'prompts user to enter a new branch name' do
71
92
  should meet_expectations
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thegarage-gitx
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
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-08-27 00:00:00.000000000 Z
11
+ date: 2014-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged