git-process 0.9.1.pre3 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/CHANGELOG.md +0 -0
  2. data/Gemfile +2 -2
  3. data/Gemfile.lock +2 -0
  4. data/README.md +27 -9
  5. data/bin/git-new-fb +42 -13
  6. data/bin/git-pull-request +79 -13
  7. data/bin/git-sync +47 -13
  8. data/bin/git-to-master +56 -13
  9. data/git-process.gemspec +1 -1
  10. data/lib/git-process/{abstract-error-builder.rb → abstract_error_builder.rb} +13 -3
  11. data/lib/git-process/{git-abstract-merge-error-builder.rb → git_abstract_merge_error_builder.rb} +15 -5
  12. data/lib/git-process/{git-branch.rb → git_branch.rb} +13 -1
  13. data/lib/git-process/git_branches.rb +72 -0
  14. data/lib/git-process/{git-lib.rb → git_lib.rb} +82 -70
  15. data/lib/git-process/git_merge_error.rb +38 -0
  16. data/lib/git-process/git_process.rb +124 -0
  17. data/lib/git-process/git_process_error.rb +18 -0
  18. data/lib/git-process/git_process_options.rb +101 -0
  19. data/lib/git-process/git_rebase_error.rb +38 -0
  20. data/lib/git-process/{git-status.rb → git_status.rb} +13 -1
  21. data/lib/git-process/{github-client.rb → github_client.rb} +13 -1
  22. data/lib/git-process/github_pull_request.rb +107 -0
  23. data/lib/git-process/{github-service.rb → github_service.rb} +39 -21
  24. data/lib/git-process/new_fb.rb +40 -0
  25. data/lib/git-process/parked_changes_error.rb +40 -0
  26. data/lib/git-process/pull_request.rb +61 -0
  27. data/lib/git-process/rebase_to_master.rb +110 -0
  28. data/lib/git-process/sync.rb +63 -0
  29. data/lib/git-process/uncommitted_changes_error.rb +23 -0
  30. data/lib/git-process/version.rb +19 -9
  31. data/spec/GitRepoHelper.rb +35 -21
  32. data/spec/{git-abstract-merge-error-builder_spec.rb → git_abstract_merge_error_builder_spec.rb} +3 -3
  33. data/spec/{git-lib_spec.rb → git_lib_spec.rb} +79 -16
  34. data/spec/git_process_spec.rb +36 -0
  35. data/spec/{git-status_spec.rb → git_status_spec.rb} +28 -29
  36. data/spec/github_pull_request_spec.rb +91 -0
  37. data/spec/{github-service_spec.rb → github_service_spec.rb} +1 -1
  38. data/spec/new_fb_spec.rb +80 -0
  39. data/spec/rebase_to_master_spec.rb +314 -0
  40. data/spec/spec_helper.rb +1 -1
  41. data/spec/sync_spec.rb +149 -0
  42. metadata +46 -43
  43. data/lib/git-process/git-branches.rb +0 -53
  44. data/lib/git-process/git-merge-error.rb +0 -31
  45. data/lib/git-process/git-new-fb-options.rb +0 -34
  46. data/lib/git-process/git-process-error.rb +0 -10
  47. data/lib/git-process/git-process-options.rb +0 -82
  48. data/lib/git-process/git-process.rb +0 -194
  49. data/lib/git-process/git-pull-request-options.rb +0 -42
  50. data/lib/git-process/git-rebase-error.rb +0 -31
  51. data/lib/git-process/git-sync-options.rb +0 -34
  52. data/lib/git-process/git-to-master-options.rb +0 -18
  53. data/lib/git-process/parked-changes-error.rb +0 -32
  54. data/lib/git-process/pull-request.rb +0 -38
  55. data/lib/git-process/uncommitted-changes-error.rb +0 -15
  56. data/spec/git-process_spec.rb +0 -328
  57. data/spec/pull-request_spec.rb +0 -57
@@ -0,0 +1,314 @@
1
+ require 'git-process/rebase_to_master'
2
+ require 'GitRepoHelper'
3
+ require 'webmock/rspec'
4
+ require 'json'
5
+
6
+ describe GitProc::RebaseToMaster do
7
+ include GitRepoHelper
8
+
9
+ before(:each) do
10
+ create_files(['.gitignore'])
11
+ gitprocess.commit('initial')
12
+ end
13
+
14
+
15
+ after(:each) do
16
+ rm_rf(tmpdir)
17
+ end
18
+
19
+
20
+ def create_process(dir, opts)
21
+ GitProc::RebaseToMaster.new(dir, opts)
22
+ end
23
+
24
+
25
+ describe "rebase to master" do
26
+
27
+ def log_level
28
+ Logger::ERROR
29
+ end
30
+
31
+
32
+ it "should work easily for a simple rebase" do
33
+ gitprocess.checkout('fb', :new_branch => 'master')
34
+ change_file_and_commit('a', '')
35
+
36
+ commit_count.should == 2
37
+
38
+ gitprocess.checkout('master')
39
+ change_file_and_commit('b', '')
40
+
41
+ gitprocess.checkout('fb')
42
+
43
+ gitprocess.run
44
+
45
+ commit_count.should == 3
46
+ end
47
+
48
+
49
+ it "should work for a rebase after a rerere merge" do
50
+ # Make sure rerere is enabled
51
+ gitprocess.rerere_enabled(true, false)
52
+ gitprocess.rerere_autoupdate(false, false)
53
+
54
+ # Create the file to conflict on
55
+ change_file_and_commit('a', '')
56
+
57
+ # In the new branch, give it a new value
58
+ gitprocess.checkout('fb', :new_branch => 'master') do
59
+ change_file_and_commit('a', 'hello')
60
+ end
61
+
62
+ # Change the value as well in the origional branch
63
+ gitprocess.checkout('master') do
64
+ change_file_and_commit('a', 'goodbye')
65
+ end
66
+
67
+ # Merge in the new branch; don't error-out because will auto-fix.
68
+ gitprocess.checkout('fb') do
69
+ gitprocess.merge('master') rescue
70
+ change_file_and_commit('a', 'merged')
71
+ end
72
+
73
+ # Make another change on master
74
+ gitprocess.checkout('master') do
75
+ change_file_and_commit('b', '')
76
+ end
77
+
78
+ # Go back to the branch and try to rebase
79
+ gitprocess.checkout('fb')
80
+
81
+ begin
82
+ gitprocess.runner
83
+ raise "Should have raised RebaseError"
84
+ rescue GitProc::RebaseError => exp
85
+ exp.resolved_files.should == ['a']
86
+ exp.unresolved_files.should == []
87
+
88
+ exp.commands.length.should == 3
89
+ exp.commands[0].should match /^# Verify/
90
+ exp.commands[1].should == 'git add a'
91
+ exp.commands[2].should == 'git rebase --continue'
92
+ end
93
+ end
94
+
95
+
96
+ describe "when used on _parking_" do
97
+ it 'should fail #rebase_to_master' do
98
+ gitprocess.checkout('_parking_', :new_branch => 'master')
99
+ change_file_and_commit('a', '')
100
+
101
+ expect {gitprocess.runner}.should raise_error GitProc::ParkedChangesError
102
+ end
103
+ end
104
+
105
+
106
+ describe "closing the pull request" do
107
+
108
+ def log_level
109
+ Logger::ERROR
110
+ end
111
+
112
+
113
+ it "should work for an existing pull request" do
114
+ gitprocess.branch('fb', :base_branch => 'master')
115
+ clone('fb') do |gp|
116
+ stub_request(:get, /test_repo\/pulls\?access_token=/).
117
+ to_return(:status => 200, :body => JSON([{:number => 987, :state => 'open', :html_url => 'test_url', :head => {:ref => 'fb'}, :base => {:ref => 'master'}}]))
118
+ stub_request(:patch, /test_repo\/pulls\/987\?access_token=/).
119
+ with(:body => JSON({:state => 'closed'})).
120
+ to_return(:status => 200, :body => JSON([{:number => 987, :state => 'closed', :html_url => 'test_url', :head => {:ref => 'fb'}, :base => {:ref => 'master'}}]))
121
+ gp.config('gitProcess.github.authToken', 'test-token')
122
+ gp.config('remote.origin.url', 'git@github.com:test_repo.git')
123
+ gp.config('github.user', 'test_user')
124
+ gp.stub(:fetch)
125
+ gp.stub(:push)
126
+
127
+ gp.runner
128
+ end
129
+ end
130
+
131
+
132
+ it "should not try when there is no auth token" do
133
+ gitprocess.branch('fb', :base_branch => 'master')
134
+ clone('fb') do |gp|
135
+ gp.config('gitProcess.github.authToken', '')
136
+ gp.config('remote.origin.url', 'git@github.com:test_repo.git')
137
+ gp.config('github.user', 'test_user')
138
+ gp.stub(:fetch)
139
+ gp.stub(:push)
140
+
141
+ gp.runner
142
+ end
143
+ end
144
+
145
+
146
+ it "should not try when there is a file:// origin url" do
147
+ gitprocess.branch('fb', :base_branch => 'master')
148
+ clone('fb') do |gp|
149
+ gp.config('gitProcess.github.authToken', 'test-token')
150
+ gp.config('github.user', 'test_user')
151
+ gp.stub(:fetch)
152
+ gp.stub(:push)
153
+
154
+ gp.runner
155
+ end
156
+ end
157
+
158
+ end
159
+
160
+ end
161
+
162
+
163
+ describe "custom integration branch" do
164
+
165
+ def log_level
166
+ Logger::ERROR
167
+ end
168
+
169
+
170
+ it "should use the 'gitProcess.integrationBranch' configuration" do
171
+ gitprocess.checkout('int-br', :new_branch => 'master') do
172
+ change_file_and_commit('a', '')
173
+ end
174
+ gitprocess.checkout('fb', :new_branch => 'master') do
175
+ change_file_and_commit('b', '')
176
+ end
177
+ gitprocess.branches['master'].delete
178
+
179
+ clone('int-br') do |gl|
180
+ gl.config('gitProcess.integrationBranch', 'int-br')
181
+
182
+ gl.checkout('ab', :new_branch => 'origin/int-br')
183
+
184
+ branches = gl.branches
185
+ branches.include?('origin/master').should be_false
186
+ branches['ab'].sha.should == branches['origin/int-br'].sha
187
+
188
+ gl.stub(:repo_name).and_return('test_repo')
189
+
190
+ change_file_and_commit('c', '', gl)
191
+
192
+ branches = gl.branches
193
+ branches['ab'].sha.should_not == branches['origin/int-br'].sha
194
+
195
+ gl.run
196
+
197
+ branches = gl.branches
198
+ branches['HEAD'].sha.should == branches['origin/int-br'].sha
199
+ end
200
+ end
201
+
202
+ end
203
+
204
+
205
+ describe "remove current feature branch" do
206
+
207
+ def log_level
208
+ Logger::ERROR
209
+ end
210
+
211
+
212
+ describe "when handling the parking branch" do
213
+
214
+ it "should create it based on origin/master" do
215
+ gitprocess.branch('fb', :base_branch => 'master')
216
+ clone('fb') do |gp|
217
+ gp.remove_feature_branch
218
+ gp.branches.current.name.should == '_parking_'
219
+ end
220
+ end
221
+
222
+
223
+ it "should move it to the new origin/master if it already exists and is clean" do
224
+ clone do |gp|
225
+ gp.branch('_parking_', :base_branch => 'origin/master')
226
+ change_file_and_commit('a', '', gp)
227
+
228
+ gp.checkout('fb', :new_branch => 'origin/master')
229
+
230
+ gp.remove_feature_branch
231
+
232
+ gp.branches.current.name.should == '_parking_'
233
+ end
234
+ end
235
+
236
+
237
+ it "should move it to the new origin/master if it already exists and changes are part of the current branch" do
238
+ gitprocess.checkout('afb', :new_branch => 'master')
239
+ clone do |gp|
240
+ gp.checkout('_parking_', :new_branch => 'origin/master') do
241
+ change_file_and_commit('a', '', gp)
242
+ end
243
+
244
+ gp.checkout('fb', :new_branch => '_parking_')
245
+ gp.push('origin', 'fb', 'master')
246
+
247
+ gp.remove_feature_branch
248
+ gp.branches.current.name.should == '_parking_'
249
+ end
250
+ end
251
+
252
+
253
+ it "should move it out of the way if it has unaccounted changes on it" do
254
+ clone do |gp|
255
+ gp.checkout('_parking_', :new_branch => 'origin/master')
256
+ change_file_and_commit('a', '', gp)
257
+ gp.checkout('fb', :new_branch => 'origin/master')
258
+
259
+ gp.branches.include?('_parking_OLD_').should be_false
260
+
261
+ gp.remove_feature_branch
262
+
263
+ gp.branches.include?('_parking_OLD_').should be_true
264
+ gp.branches.current.name.should == '_parking_'
265
+ end
266
+ end
267
+
268
+ end
269
+
270
+
271
+ it "should delete the old local branch when it has been merged into origin/master" do
272
+ clone do |gp|
273
+ change_file_and_commit('a', '', gp)
274
+
275
+ gp.checkout('fb', :new_branch => 'origin/master')
276
+ gp.branches.include?('fb').should be_true
277
+
278
+ gp.remove_feature_branch
279
+
280
+ gp.branches.include?('fb').should be_false
281
+ gp.branches.current.name.should == '_parking_'
282
+ end
283
+ end
284
+
285
+
286
+ it "should raise an error when the local branch has not been merged into origin/master" do
287
+ clone do |gp|
288
+ gp.checkout('fb', :new_branch => 'origin/master')
289
+ change_file_and_commit('a', '', gp)
290
+
291
+ gp.branches.include?('fb').should be_true
292
+
293
+ expect {gp.remove_feature_branch}.should raise_error GitProc::GitProcessError
294
+ end
295
+ end
296
+
297
+
298
+ it "should delete the old remote branch" do
299
+ change_file_and_commit('a', '')
300
+
301
+ gitprocess.branch('fb', :base_branch => 'master')
302
+
303
+ clone('fb') do |gp|
304
+ gp.branches.include?('origin/fb').should be_true
305
+ gp.remove_feature_branch
306
+ gp.branches.include?('origin/fb').should be_false
307
+ gitprocess.branches.include?('fb').should be_false
308
+ gp.branches.current.name.should == '_parking_'
309
+ end
310
+ end
311
+
312
+ end
313
+
314
+ end
data/spec/spec_helper.rb CHANGED
@@ -1 +1 @@
1
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '../lib/git-process')
1
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '../lib')
data/spec/sync_spec.rb ADDED
@@ -0,0 +1,149 @@
1
+ require 'git-process/sync'
2
+ require 'GitRepoHelper'
3
+
4
+ describe GitProc::Sync do
5
+ include GitRepoHelper
6
+
7
+ before(:each) do
8
+ create_files(['.gitignore'])
9
+ gitprocess.commit('initial')
10
+ end
11
+
12
+
13
+ after(:each) do
14
+ rm_rf(tmpdir)
15
+ end
16
+
17
+
18
+ def create_process(dir, opts)
19
+ opts[:rebase] = false
20
+ opts[:force] = false
21
+ GitProc::Sync.new(dir, opts)
22
+ end
23
+
24
+
25
+ describe "#run" do
26
+
27
+ def log_level
28
+ Logger::ERROR
29
+ end
30
+
31
+
32
+ it "should work when pushing with fast-forward" do
33
+ change_file_and_commit('a', '')
34
+
35
+ gitprocess.branch('fb', :base_branch => 'master')
36
+
37
+ clone('fb') do |gp|
38
+ change_file_and_commit('a', 'hello', gp)
39
+ gp.branches.include?('origin/fb').should be_true
40
+ gp.run
41
+ gp.branches.include?('origin/fb').should be_true
42
+ gitprocess.branches.include?('fb').should be_true
43
+ end
44
+ end
45
+
46
+
47
+ it "should work with a different remote server name" do
48
+ change_file_and_commit('a', '')
49
+
50
+ gitprocess.branch('fb', :base_branch => 'master')
51
+
52
+ clone('fb', 'a_remote') do |gp|
53
+ change_file_and_commit('a', 'hello', gp)
54
+ gp.branches.include?('a_remote/fb').should be_true
55
+ gp.run
56
+ gp.branches.include?('a_remote/fb').should be_true
57
+ gitprocess.branches.include?('fb').should be_true
58
+ end
59
+ end
60
+
61
+
62
+ it "should fail when pushing with non-fast-forward and no force" do
63
+ change_file_and_commit('a', '')
64
+
65
+ gitprocess.branch('fb', :base_branch => 'master')
66
+
67
+ clone('fb') do |gp|
68
+ gitprocess.checkout('fb') do
69
+ change_file_and_commit('a', 'hello', gitprocess)
70
+ end
71
+
72
+ expect {gp.run}.should raise_error GitProc::GitExecuteError
73
+ end
74
+ end
75
+
76
+ end
77
+
78
+
79
+ describe "when forcing the push" do
80
+
81
+ def create_process(dir, opts)
82
+ opts[:force] = false
83
+ opts[:force] = true
84
+ GitProc::Sync.new(dir, opts)
85
+ end
86
+
87
+
88
+ it "should work when pushing with non-fast-forward" do
89
+ change_file_and_commit('a', '')
90
+
91
+ gitprocess.branch('fb', :base_branch => 'master')
92
+
93
+ clone('fb') do |gp|
94
+ gitprocess.checkout('fb') do
95
+ change_file_and_commit('a', 'hello', gp)
96
+ end
97
+
98
+ expect {gp.run}.should_not raise_error GitProc::GitExecuteError
99
+ end
100
+ end
101
+
102
+ end
103
+
104
+
105
+ describe "sync_with_server with different remote name" do
106
+
107
+ def log_level
108
+ Logger::ERROR
109
+ end
110
+
111
+
112
+ def create_process(dir, opts)
113
+ opts[:force] = false
114
+ opts[:force] = true
115
+ gp = GitProc::Sync.new(dir, opts)
116
+ gp.instance_variable_set('@server_name', 'a_remote')
117
+ gp
118
+ end
119
+
120
+
121
+ it "should work with a different remote server name" do
122
+ change_file_and_commit('a', '')
123
+
124
+ gitprocess.branch('fb', :base_branch => 'master')
125
+
126
+ clone('fb', 'a_remote') do |gp|
127
+ change_file_and_commit('a', 'hello', gp)
128
+ gp.branches.include?('a_remote/fb').should be_true
129
+ gp.run
130
+ gp.branches.include?('a_remote/fb').should be_true
131
+ gitprocess.branches.include?('fb').should be_true
132
+ end
133
+ end
134
+
135
+ end
136
+
137
+
138
+ describe "remove current feature branch when used while on _parking_" do
139
+
140
+ it 'should fail #sync_with_server' do
141
+ gitprocess.checkout('_parking_', :new_branch => 'master')
142
+ change_file_and_commit('a', '')
143
+
144
+ expect {gitprocess.runner}.should raise_error GitProc::ParkedChangesError
145
+ end
146
+
147
+ end
148
+
149
+ end
metadata CHANGED
@@ -1,14 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-process
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: true
4
+ prerelease: false
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 1
9
- - pre
10
- - 3
11
- version: 0.9.1.pre3
8
+ - 2
9
+ version: 0.9.2
12
10
  platform: ruby
13
11
  authors:
14
12
  - Jim Moore
@@ -16,7 +14,7 @@ autorequire:
16
14
  bindir: bin
17
15
  cert_chain: []
18
16
 
19
- date: 2012-07-02 00:00:00 -06:00
17
+ date: 2012-07-10 00:00:00 -06:00
20
18
  default_executable:
21
19
  dependencies:
22
20
  - !ruby/object:Gem::Dependency
@@ -47,6 +45,7 @@ files:
47
45
  - .gitignore
48
46
  - .rspec
49
47
  - .travis.yml
48
+ - CHANGELOG.md
50
49
  - Gemfile
51
50
  - Gemfile.lock
52
51
  - LICENSE
@@ -57,36 +56,39 @@ files:
57
56
  - bin/git-sync
58
57
  - bin/git-to-master
59
58
  - git-process.gemspec
60
- - lib/git-process/abstract-error-builder.rb
61
- - lib/git-process/git-abstract-merge-error-builder.rb
62
- - lib/git-process/git-branch.rb
63
- - lib/git-process/git-branches.rb
64
- - lib/git-process/git-lib.rb
65
- - lib/git-process/git-merge-error.rb
66
- - lib/git-process/git-new-fb-options.rb
67
- - lib/git-process/git-process-error.rb
68
- - lib/git-process/git-process-options.rb
69
- - lib/git-process/git-process.rb
70
- - lib/git-process/git-pull-request-options.rb
71
- - lib/git-process/git-rebase-error.rb
72
- - lib/git-process/git-status.rb
73
- - lib/git-process/git-sync-options.rb
74
- - lib/git-process/git-to-master-options.rb
75
- - lib/git-process/github-client.rb
76
- - lib/git-process/github-service.rb
77
- - lib/git-process/parked-changes-error.rb
78
- - lib/git-process/pull-request.rb
79
- - lib/git-process/uncommitted-changes-error.rb
59
+ - lib/git-process/abstract_error_builder.rb
60
+ - lib/git-process/git_abstract_merge_error_builder.rb
61
+ - lib/git-process/git_branch.rb
62
+ - lib/git-process/git_branches.rb
63
+ - lib/git-process/git_lib.rb
64
+ - lib/git-process/git_merge_error.rb
65
+ - lib/git-process/git_process.rb
66
+ - lib/git-process/git_process_error.rb
67
+ - lib/git-process/git_process_options.rb
68
+ - lib/git-process/git_rebase_error.rb
69
+ - lib/git-process/git_status.rb
70
+ - lib/git-process/github_client.rb
71
+ - lib/git-process/github_pull_request.rb
72
+ - lib/git-process/github_service.rb
73
+ - lib/git-process/new_fb.rb
74
+ - lib/git-process/parked_changes_error.rb
75
+ - lib/git-process/pull_request.rb
76
+ - lib/git-process/rebase_to_master.rb
77
+ - lib/git-process/sync.rb
78
+ - lib/git-process/uncommitted_changes_error.rb
80
79
  - lib/git-process/version.rb
81
80
  - spec/FileHelpers.rb
82
81
  - spec/GitRepoHelper.rb
83
- - spec/git-abstract-merge-error-builder_spec.rb
84
- - spec/git-lib_spec.rb
85
- - spec/git-process_spec.rb
86
- - spec/git-status_spec.rb
87
- - spec/github-service_spec.rb
88
- - spec/pull-request_spec.rb
82
+ - spec/git_abstract_merge_error_builder_spec.rb
83
+ - spec/git_lib_spec.rb
84
+ - spec/git_process_spec.rb
85
+ - spec/git_status_spec.rb
86
+ - spec/github_pull_request_spec.rb
87
+ - spec/github_service_spec.rb
88
+ - spec/new_fb_spec.rb
89
+ - spec/rebase_to_master_spec.rb
89
90
  - spec/spec_helper.rb
91
+ - spec/sync_spec.rb
90
92
  has_rdoc: true
91
93
  homepage: http://jdigger.github.com/git-process/
92
94
  licenses: []
@@ -107,13 +109,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
107
109
  version: 1.8.7
108
110
  required_rubygems_version: !ruby/object:Gem::Requirement
109
111
  requirements:
110
- - - ">"
112
+ - - ">="
111
113
  - !ruby/object:Gem::Version
112
114
  segments:
113
- - 1
114
- - 3
115
- - 1
116
- version: 1.3.1
115
+ - 0
116
+ version: "0"
117
117
  requirements: []
118
118
 
119
119
  rubyforge_project:
@@ -124,10 +124,13 @@ summary: A set of scripts for a good git process
124
124
  test_files:
125
125
  - spec/FileHelpers.rb
126
126
  - spec/GitRepoHelper.rb
127
- - spec/git-abstract-merge-error-builder_spec.rb
128
- - spec/git-lib_spec.rb
129
- - spec/git-process_spec.rb
130
- - spec/git-status_spec.rb
131
- - spec/github-service_spec.rb
132
- - spec/pull-request_spec.rb
127
+ - spec/git_abstract_merge_error_builder_spec.rb
128
+ - spec/git_lib_spec.rb
129
+ - spec/git_process_spec.rb
130
+ - spec/git_status_spec.rb
131
+ - spec/github_pull_request_spec.rb
132
+ - spec/github_service_spec.rb
133
+ - spec/new_fb_spec.rb
134
+ - spec/rebase_to_master_spec.rb
133
135
  - spec/spec_helper.rb
136
+ - spec/sync_spec.rb
@@ -1,53 +0,0 @@
1
- require 'git-branch'
2
-
3
- module Git
4
-
5
- class GitBranches
6
- include Enumerable
7
-
8
- def initialize(lib)
9
- branch_lines = lib.branch(nil, :all => true, :no_color => true).split("\n")
10
- @items = SortedSet.new
11
- branch_lines.each do |bl|
12
- @items << GitBranch.new(bl[2..-1], bl[0..0] == '*', lib)
13
- end
14
- end
15
-
16
-
17
- def <<(item)
18
- @items << item
19
- end
20
-
21
-
22
- def each(&block)
23
- @items.each {|b| block.call(b)}
24
- end
25
-
26
-
27
- def names
28
- @items.map {|b| b.name}
29
- end
30
-
31
-
32
- def current
33
- @items.find {|b| b.current? }
34
- end
35
-
36
-
37
- def parking
38
- @items.find {|b| b.name == '_parking_' }
39
- end
40
-
41
-
42
- def include?(branch_name)
43
- @items.find {|b| b.name == branch_name} != nil
44
- end
45
-
46
-
47
- def [](branch_name)
48
- @items.find {|b| b.name == branch_name}
49
- end
50
-
51
- end
52
-
53
- end
@@ -1,31 +0,0 @@
1
- require 'git-process-error'
2
- require 'git-abstract-merge-error-builder'
3
-
4
- module Git
5
-
6
- class Process
7
-
8
- class MergeError < GitProcessError
9
- include Git::AbstractMergeErrorBuilder
10
-
11
- attr_reader :error_message, :lib
12
-
13
- def initialize(merge_error_message, lib)
14
- @lib = lib
15
- @error_message = merge_error_message
16
-
17
- msg = build_message
18
-
19
- super(msg)
20
- end
21
-
22
-
23
- def continue_command
24
- 'git commit'
25
- end
26
-
27
- end
28
-
29
- end
30
-
31
- end