git-process 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/README.md +52 -35
- data/bin/git-sync +5 -0
- data/lib/git-process/changed_file_helper.rb +106 -0
- data/lib/git-process/git_branch.rb +1 -1
- data/lib/git-process/git_branches.rb +1 -1
- data/lib/git-process/git_lib.rb +36 -6
- data/lib/git-process/git_process.rb +76 -11
- data/lib/git-process/git_status.rb +32 -12
- data/lib/git-process/new_fb.rb +1 -1
- data/lib/git-process/rebase_to_master.rb +12 -5
- data/lib/git-process/sync.rb +19 -4
- data/lib/git-process/version.rb +1 -1
- data/spec/changed_file_helper_spec.rb +143 -0
- data/spec/git_process_spec.rb +171 -0
- data/spec/git_status_spec.rb +23 -2
- data/spec/new_fb_spec.rb +4 -4
- data/spec/rebase_to_master_spec.rb +58 -72
- data/spec/sync_spec.rb +41 -42
- metadata +6 -3
data/spec/sync_spec.rb
CHANGED
@@ -30,13 +30,12 @@ describe GitProc::Sync do
|
|
30
30
|
|
31
31
|
gitprocess.branch('fb', :base_branch => 'master')
|
32
32
|
|
33
|
-
clone('fb')
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
end
|
33
|
+
gp = clone('fb')
|
34
|
+
change_file_and_commit('a', 'hello', gp)
|
35
|
+
gp.branches.include?('origin/fb').should be_true
|
36
|
+
GitProc::Sync.new(gp.workdir, {:rebase => false, :force => false, :log_level => log_level}).runner
|
37
|
+
gp.branches.include?('origin/fb').should be_true
|
38
|
+
gitprocess.branches.include?('fb').should be_true
|
40
39
|
end
|
41
40
|
|
42
41
|
|
@@ -45,13 +44,12 @@ describe GitProc::Sync do
|
|
45
44
|
|
46
45
|
gitprocess.branch('fb', :base_branch => 'master')
|
47
46
|
|
48
|
-
clone('fb', 'a_remote')
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
end
|
47
|
+
gp = clone('fb', 'a_remote')
|
48
|
+
change_file_and_commit('a', 'hello', gp)
|
49
|
+
gp.branches.include?('a_remote/fb').should be_true
|
50
|
+
GitProc::Sync.new(gp.workdir, {:rebase => false, :force => false, :log_level => log_level}).runner
|
51
|
+
gp.branches.include?('a_remote/fb').should be_true
|
52
|
+
gitprocess.branches.include?('fb').should be_true
|
55
53
|
end
|
56
54
|
|
57
55
|
|
@@ -60,13 +58,14 @@ describe GitProc::Sync do
|
|
60
58
|
|
61
59
|
gitprocess.branch('fb', :base_branch => 'master')
|
62
60
|
|
63
|
-
clone('fb')
|
64
|
-
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
expect {gp.runner}.should raise_error GitProc::GitExecuteError
|
61
|
+
gp = clone('fb')
|
62
|
+
gitprocess.checkout('fb') do
|
63
|
+
change_file_and_commit('a', 'hello', gitprocess)
|
69
64
|
end
|
65
|
+
|
66
|
+
expect {
|
67
|
+
GitProc::Sync.new(gp.workdir, {:rebase => false, :force => false, :log_level => log_level}).runner
|
68
|
+
}.should raise_error GitProc::GitExecuteError
|
70
69
|
end
|
71
70
|
|
72
71
|
|
@@ -82,13 +81,14 @@ describe GitProc::Sync do
|
|
82
81
|
|
83
82
|
gitprocess.branch('fb', :base_branch => 'master')
|
84
83
|
|
85
|
-
clone('fb')
|
86
|
-
|
87
|
-
|
88
|
-
end
|
89
|
-
|
90
|
-
expect {gp.runner}.should_not raise_error GitProc::GitExecuteError
|
84
|
+
gp = clone('fb')
|
85
|
+
gitprocess.checkout('fb') do
|
86
|
+
change_file_and_commit('a', 'hello', gitprocess)
|
91
87
|
end
|
88
|
+
|
89
|
+
expect {
|
90
|
+
GitProc::Sync.new(dir, opts.merge({:rebase => false, :force => true, :log_level => log_level})).runner
|
91
|
+
}.should_not raise_error GitProc::GitExecuteError
|
92
92
|
end
|
93
93
|
|
94
94
|
end
|
@@ -130,16 +130,16 @@ describe GitProc::Sync do
|
|
130
130
|
|
131
131
|
gitprocess.branch('fb', :base_branch => 'master')
|
132
132
|
|
133
|
-
clone('fb')
|
134
|
-
|
135
|
-
|
136
|
-
|
133
|
+
gp = clone('fb')
|
134
|
+
gitprocess.checkout('fb') do
|
135
|
+
change_file_and_commit('a', 'hello', gitprocess)
|
136
|
+
end
|
137
137
|
|
138
|
-
|
139
|
-
|
138
|
+
sp = GitProc::Sync.new(gp.workdir, {:rebase => true, :force => false, :local => true, :log_level => log_level})
|
139
|
+
sp.should_receive(:fetch) # want to get remote changes
|
140
|
+
sp.should_not_receive(:push) # ...but not push any
|
140
141
|
|
141
|
-
|
142
|
-
end
|
142
|
+
sp.runner
|
143
143
|
end
|
144
144
|
|
145
145
|
end
|
@@ -150,13 +150,12 @@ describe GitProc::Sync do
|
|
150
150
|
|
151
151
|
gitprocess.branch('fb', :base_branch => 'master')
|
152
152
|
|
153
|
-
clone('fb', 'a_remote')
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
end
|
153
|
+
gp = clone('fb', 'a_remote')
|
154
|
+
change_file_and_commit('a', 'hello', gp)
|
155
|
+
gp.branches.include?('a_remote/fb').should be_true
|
156
|
+
GitProc::Sync.new(gp.workdir, {:rebase => false, :force => false, :log_level => log_level}).runner
|
157
|
+
gp.branches.include?('a_remote/fb').should be_true
|
158
|
+
gitprocess.branches.include?('fb').should be_true
|
160
159
|
end
|
161
160
|
|
162
161
|
|
@@ -164,7 +163,7 @@ describe GitProc::Sync do
|
|
164
163
|
gitprocess.checkout('_parking_', :new_branch => 'master')
|
165
164
|
change_file_and_commit('a', '')
|
166
165
|
|
167
|
-
expect {gitprocess.
|
166
|
+
expect {gitprocess.verify_preconditions}.should raise_error GitProc::ParkedChangesError
|
168
167
|
end
|
169
168
|
|
170
169
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 9
|
8
|
-
-
|
9
|
-
version: 0.9.
|
8
|
+
- 6
|
9
|
+
version: 0.9.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jim Moore
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-07-
|
17
|
+
date: 2012-07-25 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -211,6 +211,7 @@ files:
|
|
211
211
|
- bin/git-to-master
|
212
212
|
- git-process.gemspec
|
213
213
|
- lib/git-process/abstract_error_builder.rb
|
214
|
+
- lib/git-process/changed_file_helper.rb
|
214
215
|
- lib/git-process/git_abstract_merge_error_builder.rb
|
215
216
|
- lib/git-process/git_branch.rb
|
216
217
|
- lib/git-process/git_branches.rb
|
@@ -233,6 +234,7 @@ files:
|
|
233
234
|
- lib/git-process/version.rb
|
234
235
|
- spec/FileHelpers.rb
|
235
236
|
- spec/GitRepoHelper.rb
|
237
|
+
- spec/changed_file_helper_spec.rb
|
236
238
|
- spec/git_abstract_merge_error_builder_spec.rb
|
237
239
|
- spec/git_lib_spec.rb
|
238
240
|
- spec/git_process_spec.rb
|
@@ -278,6 +280,7 @@ summary: A set of scripts for a good git process
|
|
278
280
|
test_files:
|
279
281
|
- spec/FileHelpers.rb
|
280
282
|
- spec/GitRepoHelper.rb
|
283
|
+
- spec/changed_file_helper_spec.rb
|
281
284
|
- spec/git_abstract_merge_error_builder_spec.rb
|
282
285
|
- spec/git_lib_spec.rb
|
283
286
|
- spec/git_process_spec.rb
|