gitx 2.21.2.ci.130.1 → 2.21.2.ci.134.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/gitx/cli/base_command.rb +4 -0
- data/lib/gitx/cli/start_command.rb +2 -2
- data/lib/gitx/extensions/thor.rb +1 -1
- data/spec/gitx/cli/start_command_spec.rb +10 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGIzMjE3ZWNjNmRmNGIyYzBiYWQ4Y2I4OGUyMGYwNTEyMzlhMWM5Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MjI1MGY5MGI4MzU5ZDUyMWExYzZhOGViMWQyODMwMjg4NTc1NTA1Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzhjMmFjOWY2NWQ3ODlhNmU0M2IyYjYyZTNiM2MzY2EzNDQ4NjdkYWRiYTk5
|
10
|
+
ZDI0YWIzMTU0YjExN2FjMzI0MjExNzI3ODI5OTZiMThkYmNmOWRmMGFjN2Zi
|
11
|
+
YjU1M2MzOWY0ZTU3YjIwNmE0YTlmZTM4YWY0Njc5MzVhZWE1ZGI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NWM5ZWI3ZjRkZmI1ZmViYzcwY2FkNWI0MDhiNGRmYzVjZTQ4YmI4NzUyYmU3
|
14
|
+
MzZhNTA5YzJiMTc3MTVjMzdhY2RkYzhjYzg5ODMyZGJkYWVkZTE2ZTAxNTM1
|
15
|
+
YTA5NzIwMGRkN2YwNjIzYTQ3MDZjYzRlOTA3MmM0ZjQ3OWYxZmI=
|
@@ -16,10 +16,10 @@ module Gitx
|
|
16
16
|
end
|
17
17
|
|
18
18
|
checkout_branch config.base_branch
|
19
|
-
|
19
|
+
run_git_cmd 'pull'
|
20
20
|
repo.create_branch branch_name, config.base_branch
|
21
21
|
checkout_branch branch_name
|
22
|
-
|
22
|
+
run_git_cmd('commit', '--allow-empty', '--message', "Starting work on #{branch_name} (Issue ##{options[:issue]})") if options[:issue]
|
23
23
|
end
|
24
24
|
|
25
25
|
private
|
data/lib/gitx/extensions/thor.rb
CHANGED
@@ -11,12 +11,15 @@ describe Gitx::Cli::StartCommand do
|
|
11
11
|
end
|
12
12
|
let(:cli) { described_class.new(args, options, config) }
|
13
13
|
let(:repo) { cli.send(:repo) }
|
14
|
+
let(:exit_value) { double(:exit_value, success?: true) }
|
15
|
+
let(:thread) { double(:thread, value: exit_value) }
|
16
|
+
let(:stdoutput) { StringIO.new('') }
|
14
17
|
|
15
18
|
describe '#start' do
|
16
19
|
context 'when user inputs branch that is valid' do
|
17
20
|
before do
|
18
21
|
expect(cli).to receive(:checkout_branch).with('master').ordered
|
19
|
-
expect(
|
22
|
+
expect(Open3).to receive(:popen2e).with('git', 'pull').and_yield(nil, stdoutput, thread).ordered
|
20
23
|
expect(repo).to receive(:create_branch).with('new-branch', 'master').ordered
|
21
24
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
22
25
|
|
@@ -31,7 +34,7 @@ describe Gitx::Cli::StartCommand do
|
|
31
34
|
expect(cli).to receive(:ask).and_return('new-branch')
|
32
35
|
|
33
36
|
expect(cli).to receive(:checkout_branch).with('master').ordered
|
34
|
-
expect(
|
37
|
+
expect(Open3).to receive(:popen2e).with('git', 'pull').and_yield(nil, stdoutput, thread).ordered
|
35
38
|
expect(repo).to receive(:create_branch).with('new-branch', 'master').ordered
|
36
39
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
37
40
|
|
@@ -46,7 +49,7 @@ describe Gitx::Cli::StartCommand do
|
|
46
49
|
expect(cli).to receive(:ask).and_return('new-branch')
|
47
50
|
|
48
51
|
expect(cli).to receive(:checkout_branch).with('master').ordered
|
49
|
-
expect(
|
52
|
+
expect(Open3).to receive(:popen2e).with('git', 'pull').and_yield(nil, stdoutput, thread).ordered
|
50
53
|
expect(repo).to receive(:create_branch).with('new-branch', 'master').ordered
|
51
54
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
52
55
|
|
@@ -64,7 +67,7 @@ describe Gitx::Cli::StartCommand do
|
|
64
67
|
expect(cli).to receive(:ask).and_return('new-branch')
|
65
68
|
|
66
69
|
expect(cli).to receive(:checkout_branch).with('master').ordered
|
67
|
-
expect(
|
70
|
+
expect(Open3).to receive(:popen2e).with('git', 'pull').and_yield(nil, stdoutput, thread).ordered
|
68
71
|
expect(repo).to receive(:create_branch).with('new-branch', 'master').ordered
|
69
72
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
70
73
|
|
@@ -82,7 +85,7 @@ describe Gitx::Cli::StartCommand do
|
|
82
85
|
expect(cli).to receive(:ask).and_return('new-branch')
|
83
86
|
|
84
87
|
expect(cli).to receive(:checkout_branch).with('master').ordered
|
85
|
-
expect(
|
88
|
+
expect(Open3).to receive(:popen2e).with('git', 'pull').and_yield(nil, stdoutput, thread).ordered
|
86
89
|
expect(repo).to receive(:create_branch).with('new-branch', 'master').ordered
|
87
90
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
88
91
|
|
@@ -100,10 +103,10 @@ describe Gitx::Cli::StartCommand do
|
|
100
103
|
end
|
101
104
|
before do
|
102
105
|
expect(cli).to receive(:checkout_branch).with('master').ordered
|
103
|
-
expect(
|
106
|
+
expect(Open3).to receive(:popen2e).with('git', 'pull').and_yield(nil, stdoutput, thread).ordered
|
104
107
|
expect(repo).to receive(:create_branch).with('new-branch', 'master').ordered
|
105
108
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
106
|
-
expect(
|
109
|
+
expect(Open3).to receive(:popen2e).with('git', 'commit', '--allow-empty', '--message', 'Starting work on new-branch (Issue #10)').and_yield(nil, stdoutput, thread).ordered
|
107
110
|
|
108
111
|
cli.start 'new-branch'
|
109
112
|
end
|