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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmNiYzc5OWViYWQ3OTdlMWUxZjk0ZTcyZjQ3YzU0MGFhOWZkOGU2Mw==
4
+ ZGIzMjE3ZWNjNmRmNGIyYzBiYWQ4Y2I4OGUyMGYwNTEyMzlhMWM5Mg==
5
5
  data.tar.gz: !binary |-
6
- NDMwNTQ5MGU0ODBkNjk1NzM5MmZiNTM1MzA0YmM5ZmQ5NjU0MzE5NQ==
6
+ MjI1MGY5MGI4MzU5ZDUyMWExYzZhOGViMWQyODMwMjg4NTc1NTA1Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Zjc0OGQxOTJiZTAzYzhiOTNkMGYyMTgwODNhMzJjNWIwYmYzMGExNTdmOWU2
10
- NDEzNmM0ODg3Yjc2ODMxY2Q2OGJlZjU2MGQzMGNiN2I2NDkyY2U0MzJkMDlm
11
- NjdmMjA1Y2Q2ZDc5NmU4NmZkNmQ2MzAxMzg4OGExODVmYWQzNGE=
9
+ MzhjMmFjOWY2NWQ3ODlhNmU0M2IyYjYyZTNiM2MzY2EzNDQ4NjdkYWRiYTk5
10
+ ZDI0YWIzMTU0YjExN2FjMzI0MjExNzI3ODI5OTZiMThkYmNmOWRmMGFjN2Zi
11
+ YjU1M2MzOWY0ZTU3YjIwNmE0YTlmZTM4YWY0Njc5MzVhZWE1ZGI=
12
12
  data.tar.gz: !binary |-
13
- MjU4NmIwMzMzZmMwNzhmZWQ2YTNmZDA4NWZmN2I4ZDc1YTIxZDIwYWE0NGYz
14
- NWQxZTM2ZDliMmU4ODI5Nzk1OTY1ZTNmNTBlNTdlYWE5NzQ4ZDFkNDY4YjZi
15
- NTE1YTkzOTdjMGQ5YjI1NmViZTA5YmJkZjU4NmNjYjI3MDlmN2U=
13
+ NWM5ZWI3ZjRkZmI1ZmViYzcwY2FkNWI0MDhiNGRmYzVjZTQ4YmI4NzUyYmU3
14
+ MzZhNTA5YzJiMTc3MTVjMzdhY2RkYzhjYzg5ODMyZGJkYWVkZTE2ZTAxNTM1
15
+ YTA5NzIwMGRkN2YwNjIzYTQ3MDZjYzRlOTA3MmM0ZjQ3OWYxZmI=
@@ -26,6 +26,10 @@ module Gitx
26
26
  end
27
27
  end
28
28
 
29
+ def run_git_cmd(*cmd)
30
+ run_cmd('git', *cmd)
31
+ end
32
+
29
33
  def checkout_branch(branch_name)
30
34
  run_cmd "git checkout #{branch_name}"
31
35
  end
@@ -16,10 +16,10 @@ module Gitx
16
16
  end
17
17
 
18
18
  checkout_branch config.base_branch
19
- run_cmd 'git pull'
19
+ run_git_cmd 'pull'
20
20
  repo.create_branch branch_name, config.base_branch
21
21
  checkout_branch branch_name
22
- run_cmd(%Q(git commit -m "Starting work on #{branch_name} (Issue ##{options[:issue]})" --allow-empty)) if options[:issue]
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
@@ -12,7 +12,7 @@ class Thor
12
12
 
13
13
  Open3.popen2e(*cmd) do |stdin, stdout_err, wait_thr|
14
14
  while line = stdout_err.gets
15
- say line, :yellow
15
+ say(line, :yellow) if options[:trace]
16
16
  output << line
17
17
  end
18
18
 
@@ -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(cli).to receive(:run_cmd).with('git pull').ordered
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(cli).to receive(:run_cmd).with('git pull').ordered
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(cli).to receive(:run_cmd).with('git pull').ordered
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(cli).to receive(:run_cmd).with('git pull').ordered
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(cli).to receive(:run_cmd).with('git pull').ordered
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(cli).to receive(:run_cmd).with('git pull').ordered
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(cli).to receive(:run_cmd).with('git commit -m "Starting work on new-branch (Issue #10)" --allow-empty').ordered
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitx
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.21.2.ci.130.1
4
+ version: 2.21.2.ci.134.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Sonnek