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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b6f8520b6fa00eb4d8b5bd41b2d299e82391e2d
|
4
|
+
data.tar.gz: a4ed62c3ae3a6fe20e01751690ceb441a9347a71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
27
|
+
return false if repo_branches.include?(branch)
|
28
28
|
branch =~ VALID_BRANCH_NAME_REGEX
|
29
29
|
end
|
30
30
|
|
31
|
-
def
|
32
|
-
@
|
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
|
@@ -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 '
|
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.
|
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-
|
11
|
+
date: 2014-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|