gitx 4.4.0 → 4.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.md +4 -0
- data/lib/gitx/cli/cleanup_command.rb +1 -1
- data/lib/gitx/cli/release_command.rb +1 -1
- data/lib/gitx/cli/start_command.rb +1 -1
- data/lib/gitx/cli/update_command.rb +1 -1
- data/lib/gitx/github.rb +3 -16
- data/lib/gitx/version.rb +1 -1
- data/spec/gitx/cli/cleanup_command_spec.rb +4 -4
- data/spec/gitx/cli/release_command_spec.rb +8 -8
- data/spec/gitx/cli/review_command_spec.rb +4 -62
- data/spec/gitx/cli/start_command_spec.rb +8 -8
- data/spec/gitx/cli/update_command_spec.rb +11 -11
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '03690d88d3a570105068b4795d6df494ce8a1c6e5335ba88cb0171247ee0d428'
|
4
|
+
data.tar.gz: 05cb9b78bc92596c00f32fac7954a58b79355c242480a49cde64aabfc7904498
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5de1a2c9142582d602a31c9bfec9c5a04e9af4796f6c9ad6bfb5dc7f7cf742c8c8db487fe82e3f93c663fb19184aaefe853e24a071e5cfd378edb49b36c8c614
|
7
|
+
data.tar.gz: 981d58e0239954665d5387a289891bd7bce094cce3afbeeb4ee223a3273c1d55090e33ce590db34221a72d92d92ad0829a05d22c781bc5874ee7f553747d49b3
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.3.0
|
data/README.md
CHANGED
@@ -77,6 +77,10 @@ options:
|
|
77
77
|
* `--branch` = configure the branch name related to the build tag
|
78
78
|
* `--message` = configure the git message associated to the tag
|
79
79
|
|
80
|
+
## Authentication
|
81
|
+
|
82
|
+
In order to access any of the Github APIs you will need to generate [a Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) with `repo` scopes. You will be prompted for this token before gitx accesses the Github API. After you provide the token it will be saved in `~/.config/gitx.yml` so you don't need to provide it again.
|
83
|
+
|
80
84
|
## Configuration
|
81
85
|
Any of the [default settings defined in the gem](lib/gitx/defaults.yml) can be overridden
|
82
86
|
by creating a custom `.gitx.yml` file in the root directory of your project.
|
@@ -50,7 +50,7 @@ module Gitx
|
|
50
50
|
return unless confirm_branch_status?(branch)
|
51
51
|
|
52
52
|
checkout_branch config.base_branch
|
53
|
-
run_git_cmd 'pull', 'origin', config.base_branch
|
53
|
+
run_git_cmd 'pull', 'origin', config.base_branch, '--no-rebase'
|
54
54
|
run_git_cmd 'merge', '--no-ff', '--message', commit_message(branch, pull_request), branch
|
55
55
|
run_git_cmd 'push', 'origin', 'HEAD'
|
56
56
|
end
|
@@ -14,7 +14,7 @@ module Gitx
|
|
14
14
|
branch_name = ask("What would you like to name your branch? (ex: #{EXAMPLE_BRANCH_NAMES.sample})") until valid_new_branch_name?(branch_name)
|
15
15
|
|
16
16
|
checkout_branch config.base_branch
|
17
|
-
run_git_cmd 'pull'
|
17
|
+
run_git_cmd 'pull', '--no-rebase'
|
18
18
|
repo.create_branch branch_name, config.base_branch
|
19
19
|
checkout_branch branch_name
|
20
20
|
run_git_cmd('commit', '--allow-empty', '--message', commit_message(branch_name))
|
@@ -29,7 +29,7 @@ module Gitx
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def update_branch(branch, repository: 'origin')
|
32
|
-
run_git_cmd 'pull', repository, branch
|
32
|
+
run_git_cmd 'pull', repository, branch, '--no-rebase'
|
33
33
|
rescue Gitx::Executor::ExecutionError
|
34
34
|
raise MergeError, 'Merge conflict occurred. Please fix merge conflict and rerun the command'
|
35
35
|
end
|
data/lib/gitx/github.rb
CHANGED
@@ -108,28 +108,15 @@ module Gitx
|
|
108
108
|
def authorization_token
|
109
109
|
auth_token = ENV['GITX_GITHUB_TOKEN'] || global_config['token']
|
110
110
|
auth_token ||= begin
|
111
|
-
new_token =
|
111
|
+
new_token = fetch_token
|
112
112
|
save_global_config('token' => new_token)
|
113
113
|
new_token
|
114
114
|
end
|
115
115
|
auth_token
|
116
116
|
end
|
117
117
|
|
118
|
-
def
|
119
|
-
|
120
|
-
client = Octokit::Client.new(login: username, password: password)
|
121
|
-
options = {
|
122
|
-
scopes: ['repo'],
|
123
|
-
note: github_client_name,
|
124
|
-
note_url: CLIENT_URL
|
125
|
-
}
|
126
|
-
two_factor_auth_token = ask_without_echo('Github two factor authorization token (if enabled): ')
|
127
|
-
options[:headers] = { 'X-GitHub-OTP' => two_factor_auth_token } if two_factor_auth_token
|
128
|
-
response = client.create_authorization(options)
|
129
|
-
response.token
|
130
|
-
rescue Octokit::ClientError => e
|
131
|
-
say "Error creating authorization: #{e.message}", :red
|
132
|
-
retry
|
118
|
+
def fetch_token
|
119
|
+
ask_without_echo("Github personal access token with repo scopes for #{username}: ")
|
133
120
|
end
|
134
121
|
|
135
122
|
def github_client_name
|
data/lib/gitx/version.rb
CHANGED
@@ -39,7 +39,7 @@ describe Gitx::Cli::CleanupCommand do
|
|
39
39
|
allow(cli).to receive(:say)
|
40
40
|
|
41
41
|
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
42
|
-
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
42
|
+
expect(executor).to receive(:execute).with('git', 'pull', '--no-rebase').ordered
|
43
43
|
expect(executor).to receive(:execute).with('git', 'remote', 'prune', 'origin').ordered
|
44
44
|
expect(executor).to receive(:execute).with('git', 'branch', '--delete', 'merged-local-feature').ordered
|
45
45
|
|
@@ -59,7 +59,7 @@ describe Gitx::Cli::CleanupCommand do
|
|
59
59
|
allow(cli).to receive(:say)
|
60
60
|
|
61
61
|
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
62
|
-
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
62
|
+
expect(executor).to receive(:execute).with('git', 'pull', '--no-rebase').ordered
|
63
63
|
expect(executor).to receive(:execute).with('git', 'remote', 'prune', 'origin').ordered
|
64
64
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', '--delete', 'merged-remote-feature').ordered
|
65
65
|
|
@@ -79,7 +79,7 @@ describe Gitx::Cli::CleanupCommand do
|
|
79
79
|
allow(cli).to receive(:say)
|
80
80
|
|
81
81
|
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
82
|
-
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
82
|
+
expect(executor).to receive(:execute).with('git', 'pull', '--no-rebase').ordered
|
83
83
|
expect(executor).to receive(:execute).with('git', 'remote', 'prune', 'origin').ordered
|
84
84
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', '--delete', 'merged-remote-feature/review').ordered
|
85
85
|
|
@@ -102,7 +102,7 @@ describe Gitx::Cli::CleanupCommand do
|
|
102
102
|
allow(cli).to receive(:say)
|
103
103
|
|
104
104
|
expect(executor).to receive(:execute).with('git', 'checkout', base_branch).ordered
|
105
|
-
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
105
|
+
expect(executor).to receive(:execute).with('git', 'pull', '--no-rebase').ordered
|
106
106
|
expect(executor).to receive(:execute).with('git', 'remote', 'prune', 'origin').ordered
|
107
107
|
expect(executor).to_not receive(:execute).with('git', 'push', 'origin', '--delete', base_branch)
|
108
108
|
|
@@ -42,7 +42,7 @@ describe Gitx::Cli::ReleaseCommand do
|
|
42
42
|
|
43
43
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
44
44
|
expect(executor).to_not receive(:execute).with('git', 'checkout', 'main')
|
45
|
-
expect(executor).to_not receive(:execute).with('git', 'pull', 'origin', 'main')
|
45
|
+
expect(executor).to_not receive(:execute).with('git', 'pull', 'origin', 'main', '--no-rebase')
|
46
46
|
expect(executor).to_not receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to main\n\nConnected to #10", 'feature-branch')
|
47
47
|
expect(executor).to_not receive(:execute).with('git', 'push', 'origin', 'HEAD')
|
48
48
|
|
@@ -65,7 +65,7 @@ describe Gitx::Cli::ReleaseCommand do
|
|
65
65
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
66
66
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
67
67
|
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
68
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
68
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main', '--no-rebase').ordered
|
69
69
|
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to main\n\nConnected to #10", 'feature-branch').ordered
|
70
70
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'HEAD').ordered
|
71
71
|
expect(executor).to receive(:execute).with('git integrate --skip-pull-request').ordered
|
@@ -95,7 +95,7 @@ describe Gitx::Cli::ReleaseCommand do
|
|
95
95
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
96
96
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
97
97
|
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
98
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
98
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main', '--no-rebase').ordered
|
99
99
|
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to main\n\nConnected to #10", 'feature-branch').ordered
|
100
100
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'HEAD').ordered
|
101
101
|
expect(executor).to receive(:execute).with('echo hello').ordered
|
@@ -118,7 +118,7 @@ describe Gitx::Cli::ReleaseCommand do
|
|
118
118
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
119
119
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
120
120
|
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
121
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
121
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main', '--no-rebase').ordered
|
122
122
|
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to main\n\nConnected to #10", 'feature-branch').ordered
|
123
123
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'HEAD').ordered
|
124
124
|
expect(executor).to receive(:execute).with('git integrate --skip-pull-request').ordered
|
@@ -156,7 +156,7 @@ describe Gitx::Cli::ReleaseCommand do
|
|
156
156
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
157
157
|
expect(executor).to receive(:execute).with('git', 'log', 'origin/main...feature-branch', '--reverse', '--no-merges', '--pretty=format:* %B').and_return('2013-01-01 did some stuff').ordered
|
158
158
|
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
159
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
159
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main', '--no-rebase').ordered
|
160
160
|
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to main\n\nConnected to #10", 'feature-branch').ordered
|
161
161
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'HEAD').ordered
|
162
162
|
expect(executor).to receive(:execute).with('git integrate --skip-pull-request').ordered
|
@@ -188,7 +188,7 @@ describe Gitx::Cli::ReleaseCommand do
|
|
188
188
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
189
189
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
190
190
|
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
191
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
191
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main', '--no-rebase').ordered
|
192
192
|
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to main\n\nConnected to #10", 'feature-branch').ordered
|
193
193
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'HEAD').ordered
|
194
194
|
expect(executor).to receive(:execute).with('git integrate --skip-pull-request').ordered
|
@@ -219,7 +219,7 @@ describe Gitx::Cli::ReleaseCommand do
|
|
219
219
|
allow(cli).to receive(:authorization_token).and_return(authorization_token)
|
220
220
|
|
221
221
|
expect(executor).to_not receive(:execute).with('git', 'checkout', 'main')
|
222
|
-
expect(executor).to_not receive(:execute).with('git', 'pull', 'origin', 'main')
|
222
|
+
expect(executor).to_not receive(:execute).with('git', 'pull', 'origin', 'main', '--no-rebase')
|
223
223
|
expect(executor).to_not receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to main\n\nConnected to #10", 'feature-branch')
|
224
224
|
expect(executor).to_not receive(:execute).with('git', 'push', 'origin', 'HEAD')
|
225
225
|
|
@@ -254,7 +254,7 @@ describe Gitx::Cli::ReleaseCommand do
|
|
254
254
|
|
255
255
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
256
256
|
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
257
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
257
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main', '--no-rebase').ordered
|
258
258
|
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to main\n\nConnected to #10", 'feature-branch').ordered
|
259
259
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'HEAD').ordered
|
260
260
|
expect(executor).to receive(:execute).with('git integrate --skip-pull-request').ordered
|
@@ -293,48 +293,16 @@ describe Gitx::Cli::ReviewCommand do
|
|
293
293
|
'github.user' => 'ryan@codecrate.com'
|
294
294
|
}
|
295
295
|
end
|
296
|
-
let(:
|
297
|
-
let(:authorization_token) { '123981239123' }
|
296
|
+
let(:github_personal_access_token) { 'secretz' }
|
298
297
|
before do
|
299
|
-
|
300
|
-
.with(basic_auth: ['ryan@codecrate.com', 'secretz'])
|
301
|
-
.to_return(status: 200, body: JSON.dump(token: authorization_token), headers: { 'Content-Type' => 'application/json' })
|
302
|
-
|
303
|
-
expect(cli).to receive(:ask).with('Github password for ryan@codecrate.com: ', echo: false).and_return(github_password)
|
304
|
-
expect(cli).to receive(:ask).with('Github two factor authorization token (if enabled): ', echo: false).and_return(nil)
|
298
|
+
expect(cli).to receive(:ask).with('Github personal access token for ryan@codecrate.com: ', echo: false).and_return(github_personal_access_token)
|
305
299
|
|
306
300
|
@auth_token = cli.send(:authorization_token)
|
307
301
|
end
|
308
302
|
it 'stores authorization_token in global config' do
|
309
|
-
expect(global_config).to include('token' =>
|
303
|
+
expect(global_config).to include('token' => github_personal_access_token)
|
310
304
|
end
|
311
|
-
it { expect(@auth_token).to eq
|
312
|
-
end
|
313
|
-
context 'when global authorization_token is nil and first request fails' do
|
314
|
-
let(:repo_config) do
|
315
|
-
{
|
316
|
-
'remote.origin.url' => 'https://github.com/wireframe/gitx',
|
317
|
-
'github.user' => 'ryan@codecrate.com'
|
318
|
-
}
|
319
|
-
end
|
320
|
-
let(:github_password) { 'secretz' }
|
321
|
-
let(:authorization_token) { '123981239123' }
|
322
|
-
before do
|
323
|
-
stub_request(:post, 'https://api.github.com/authorizations')
|
324
|
-
.with(basic_auth: ['ryan@codecrate.com', 'secretz'])
|
325
|
-
.to_return(status: 401, body: JSON.dump(token: authorization_token), headers: { 'Content-Type' => 'application/json' })
|
326
|
-
.then
|
327
|
-
.to_return(status: 200, body: JSON.dump(token: authorization_token), headers: { 'Content-Type' => 'application/json' })
|
328
|
-
|
329
|
-
expect(cli).to receive(:ask).with('Github password for ryan@codecrate.com: ', echo: false).and_return(github_password).twice
|
330
|
-
expect(cli).to receive(:ask).with('Github two factor authorization token (if enabled): ', echo: false).and_return(nil).twice
|
331
|
-
|
332
|
-
@auth_token = cli.send(:authorization_token)
|
333
|
-
end
|
334
|
-
it 'stores authorization_token in global config' do
|
335
|
-
expect(global_config).to include('token' => authorization_token)
|
336
|
-
end
|
337
|
-
it { expect(@auth_token).to eq authorization_token }
|
305
|
+
it { expect(@auth_token).to eq github_personal_access_token }
|
338
306
|
end
|
339
307
|
context 'when the global config has an existing token' do
|
340
308
|
let(:authorization_token) { '123981239123' }
|
@@ -357,31 +325,5 @@ describe Gitx::Cli::ReviewCommand do
|
|
357
325
|
end
|
358
326
|
it { expect(@auth_token).to eq authorization_token }
|
359
327
|
end
|
360
|
-
context 'when two factor authorization token given' do
|
361
|
-
let(:repo_config) do
|
362
|
-
{
|
363
|
-
'remote.origin.url' => 'https://github.com/wireframe/gitx',
|
364
|
-
'github.user' => 'ryan@codecrate.com'
|
365
|
-
}
|
366
|
-
end
|
367
|
-
let(:github_password) { 'secretz' }
|
368
|
-
let(:authorization_token) { '123981239123' }
|
369
|
-
let(:two_factor_auth_token) { '456456' }
|
370
|
-
before do
|
371
|
-
stub_request(:post, 'https://api.github.com/authorizations')
|
372
|
-
.with(basic_auth: ['ryan@codecrate.com', 'secretz'])
|
373
|
-
.with(headers: { 'X-GitHub-OTP' => two_factor_auth_token })
|
374
|
-
.to_return(status: 200, body: JSON.dump(token: authorization_token), headers: { 'Content-Type' => 'application/json' })
|
375
|
-
|
376
|
-
expect(cli).to receive(:ask).with('Github password for ryan@codecrate.com: ', echo: false).and_return(github_password)
|
377
|
-
expect(cli).to receive(:ask).with('Github two factor authorization token (if enabled): ', echo: false).and_return(two_factor_auth_token)
|
378
|
-
|
379
|
-
@auth_token = cli.send(:authorization_token)
|
380
|
-
end
|
381
|
-
it 'stores authorization_token in global config' do
|
382
|
-
expect(global_config).to include('token' => authorization_token)
|
383
|
-
end
|
384
|
-
it { expect(@auth_token).to eq authorization_token }
|
385
|
-
end
|
386
328
|
end
|
387
329
|
end
|
@@ -17,7 +17,7 @@ describe Gitx::Cli::StartCommand do
|
|
17
17
|
context 'when user inputs branch that is valid' do
|
18
18
|
before do
|
19
19
|
expect(cli).to receive(:checkout_branch).with('main').ordered
|
20
|
-
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
20
|
+
expect(executor).to receive(:execute).with('git', 'pull', '--no-rebase').ordered
|
21
21
|
expect(repo).to receive(:create_branch).with('new-branch', 'main').ordered
|
22
22
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
23
23
|
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', '[gitx] Start work on new-branch').ordered
|
@@ -31,7 +31,7 @@ describe Gitx::Cli::StartCommand do
|
|
31
31
|
context 'when user inputs branch with slash' do
|
32
32
|
before do
|
33
33
|
expect(cli).to receive(:checkout_branch).with('main').ordered
|
34
|
-
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
34
|
+
expect(executor).to receive(:execute).with('git', 'pull', '--no-rebase').ordered
|
35
35
|
expect(repo).to receive(:create_branch).with('foo/ryan', 'main').ordered
|
36
36
|
expect(cli).to receive(:checkout_branch).with('foo/ryan').ordered
|
37
37
|
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', '[gitx] Start work on foo/ryan').ordered
|
@@ -47,7 +47,7 @@ describe Gitx::Cli::StartCommand do
|
|
47
47
|
expect(cli).to receive(:ask).and_return('new-branch')
|
48
48
|
|
49
49
|
expect(cli).to receive(:checkout_branch).with('main').ordered
|
50
|
-
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
50
|
+
expect(executor).to receive(:execute).with('git', 'pull', '--no-rebase').ordered
|
51
51
|
expect(repo).to receive(:create_branch).with('new-branch', 'main').ordered
|
52
52
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
53
53
|
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', '[gitx] Start work on new-branch').ordered
|
@@ -63,7 +63,7 @@ describe Gitx::Cli::StartCommand do
|
|
63
63
|
expect(cli).to receive(:ask).and_return('new-branch')
|
64
64
|
|
65
65
|
expect(cli).to receive(:checkout_branch).with('main').ordered
|
66
|
-
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
66
|
+
expect(executor).to receive(:execute).with('git', 'pull', '--no-rebase').ordered
|
67
67
|
expect(repo).to receive(:create_branch).with('new-branch', 'main').ordered
|
68
68
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
69
69
|
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', '[gitx] Start work on new-branch').ordered
|
@@ -82,7 +82,7 @@ describe Gitx::Cli::StartCommand do
|
|
82
82
|
expect(cli).to receive(:ask).and_return('new-branch')
|
83
83
|
|
84
84
|
expect(cli).to receive(:checkout_branch).with('main').ordered
|
85
|
-
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
85
|
+
expect(executor).to receive(:execute).with('git', 'pull', '--no-rebase').ordered
|
86
86
|
expect(repo).to receive(:create_branch).with('new-branch', 'main').ordered
|
87
87
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
88
88
|
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', '[gitx] Start work on new-branch').ordered
|
@@ -101,7 +101,7 @@ describe Gitx::Cli::StartCommand do
|
|
101
101
|
expect(cli).to receive(:ask).and_return('new-branch')
|
102
102
|
|
103
103
|
expect(cli).to receive(:checkout_branch).with('main').ordered
|
104
|
-
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
104
|
+
expect(executor).to receive(:execute).with('git', 'pull', '--no-rebase').ordered
|
105
105
|
expect(repo).to receive(:create_branch).with('new-branch', 'main').ordered
|
106
106
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
107
107
|
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', '[gitx] Start work on new-branch').ordered
|
@@ -120,7 +120,7 @@ describe Gitx::Cli::StartCommand do
|
|
120
120
|
end
|
121
121
|
before do
|
122
122
|
expect(cli).to receive(:checkout_branch).with('main').ordered
|
123
|
-
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
123
|
+
expect(executor).to receive(:execute).with('git', 'pull', '--no-rebase').ordered
|
124
124
|
expect(repo).to receive(:create_branch).with('new-branch', 'main').ordered
|
125
125
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
126
126
|
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', "[gitx] Start work on new-branch\n\nConnected to #10").ordered
|
@@ -139,7 +139,7 @@ describe Gitx::Cli::StartCommand do
|
|
139
139
|
end
|
140
140
|
before do
|
141
141
|
expect(cli).to receive(:checkout_branch).with('main').ordered
|
142
|
-
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
142
|
+
expect(executor).to receive(:execute).with('git', 'pull', '--no-rebase').ordered
|
143
143
|
expect(repo).to receive(:create_branch).with('new-branch', 'main').ordered
|
144
144
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
145
145
|
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', "[gitx] Start work on new-branch\n\nConnected to FOO-123").ordered
|
@@ -28,10 +28,10 @@ describe Gitx::Cli::UpdateCommand do
|
|
28
28
|
allow(cli).to receive(:say)
|
29
29
|
|
30
30
|
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
31
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
31
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main', '--no-rebase').ordered
|
32
32
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
33
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'feature-branch').ordered
|
34
|
-
expect(executor).to receive(:execute).with('git', 'pull', '.', 'main').ordered
|
33
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'feature-branch', '--no-rebase').ordered
|
34
|
+
expect(executor).to receive(:execute).with('git', 'pull', '.', 'main', '--no-rebase').ordered
|
35
35
|
expect(executor).to receive(:execute).with('git', 'share').ordered
|
36
36
|
|
37
37
|
cli.update
|
@@ -45,9 +45,9 @@ describe Gitx::Cli::UpdateCommand do
|
|
45
45
|
allow(cli).to receive(:say)
|
46
46
|
|
47
47
|
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
48
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
48
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main', '--no-rebase').ordered
|
49
49
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
50
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'feature-branch').and_raise(Gitx::Executor::ExecutionError).ordered
|
50
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'feature-branch', '--no-rebase').and_raise(Gitx::Executor::ExecutionError).ordered
|
51
51
|
|
52
52
|
expect { cli.update }.to raise_error(Gitx::Cli::BaseCommand::MergeError, 'Merge conflict occurred. Please fix merge conflict and rerun the command')
|
53
53
|
end
|
@@ -60,10 +60,10 @@ describe Gitx::Cli::UpdateCommand do
|
|
60
60
|
allow(cli).to receive(:say)
|
61
61
|
|
62
62
|
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
63
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
63
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main', '--no-rebase').ordered
|
64
64
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
65
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'feature-branch').ordered
|
66
|
-
expect(executor).to receive(:execute).with('git', 'pull', '.', 'main').and_raise(Gitx::Executor::ExecutionError).ordered
|
65
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'feature-branch', '--no-rebase').ordered
|
66
|
+
expect(executor).to receive(:execute).with('git', 'pull', '.', 'main', '--no-rebase').and_raise(Gitx::Executor::ExecutionError).ordered
|
67
67
|
|
68
68
|
expect { cli.update }.to raise_error(Gitx::Cli::BaseCommand::MergeError, 'Merge conflict occurred. Please fix merge conflict and rerun the command')
|
69
69
|
end
|
@@ -76,11 +76,11 @@ describe Gitx::Cli::UpdateCommand do
|
|
76
76
|
before do
|
77
77
|
allow(cli).to receive(:say)
|
78
78
|
|
79
|
-
expect(executor).not_to receive(:execute).with('git', 'pull', 'origin', 'feature-branch')
|
79
|
+
expect(executor).not_to receive(:execute).with('git', 'pull', 'origin', 'feature-branch', '--no-rebase')
|
80
80
|
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
81
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
81
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main', '--no-rebase').ordered
|
82
82
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
83
|
-
expect(executor).to receive(:execute).with('git', 'pull', '.', 'main').ordered
|
83
|
+
expect(executor).to receive(:execute).with('git', 'pull', '.', 'main', '--no-rebase').ordered
|
84
84
|
expect(executor).to receive(:execute).with('git', 'share').ordered
|
85
85
|
|
86
86
|
cli.update
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Sonnek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|
@@ -282,7 +282,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
282
282
|
- !ruby/object:Gem::Version
|
283
283
|
version: '0'
|
284
284
|
requirements: []
|
285
|
-
rubygems_version: 3.
|
285
|
+
rubygems_version: 3.5.3
|
286
286
|
signing_key:
|
287
287
|
specification_version: 4
|
288
288
|
summary: Utility scripts for Git to increase productivity for common operations
|