git-process 1.0.11 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. data/CHANGELOG.md +37 -9
  2. data/Gemfile +2 -2
  3. data/Gemfile.lock +17 -17
  4. data/README.md +14 -7
  5. data/bin/git-new-fb +10 -2
  6. data/bin/git-pull-request +30 -6
  7. data/bin/git-sync +5 -2
  8. data/bin/git-to-master +62 -11
  9. data/git-process.gemspec +15 -15
  10. data/lib/git-process/abstract_error_builder.rb +0 -3
  11. data/lib/git-process/changed_file_helper.rb +30 -24
  12. data/lib/git-process/git_abstract_merge_error_builder.rb +31 -11
  13. data/lib/git-process/git_branch.rb +5 -0
  14. data/lib/git-process/git_config.rb +153 -0
  15. data/lib/git-process/git_lib.rb +212 -164
  16. data/lib/git-process/git_logger.rb +84 -0
  17. data/lib/git-process/git_merge_error.rb +3 -14
  18. data/lib/git-process/git_process.rb +44 -73
  19. data/lib/git-process/git_process_options.rb +6 -6
  20. data/lib/git-process/git_rebase_error.rb +4 -13
  21. data/lib/git-process/git_remote.rb +254 -0
  22. data/lib/git-process/github_configuration.rb +298 -0
  23. data/lib/git-process/github_pull_request.rb +65 -27
  24. data/lib/git-process/new_fb.rb +14 -4
  25. data/lib/git-process/parked_changes_error.rb +1 -1
  26. data/lib/git-process/pull_request.rb +100 -13
  27. data/lib/git-process/pull_request_error.rb +25 -0
  28. data/lib/git-process/rebase_to_master.rb +47 -27
  29. data/lib/git-process/sync.rb +48 -33
  30. data/lib/git-process/uncommitted_changes_error.rb +1 -1
  31. data/lib/git-process/version.rb +2 -2
  32. data/spec/GitRepoHelper.rb +48 -25
  33. data/spec/changed_file_helper_spec.rb +39 -58
  34. data/spec/git_abstract_merge_error_builder_spec.rb +42 -33
  35. data/spec/git_branch_spec.rb +30 -30
  36. data/spec/git_config_spec.rb +45 -0
  37. data/spec/git_lib_spec.rb +103 -122
  38. data/spec/git_logger_spec.rb +66 -0
  39. data/spec/git_process_spec.rb +81 -81
  40. data/spec/git_remote_spec.rb +188 -0
  41. data/spec/git_status_spec.rb +36 -36
  42. data/spec/github_configuration_spec.rb +152 -0
  43. data/spec/github_pull_request_spec.rb +39 -35
  44. data/spec/github_test_helper.rb +49 -0
  45. data/spec/new_fb_spec.rb +65 -24
  46. data/spec/pull_request_helper.rb +94 -0
  47. data/spec/pull_request_spec.rb +128 -0
  48. data/spec/rebase_to_master_spec.rb +241 -145
  49. data/spec/spec_helper.rb +20 -0
  50. data/spec/sync_spec.rb +115 -109
  51. metadata +34 -20
  52. data/lib/git-process/github_client.rb +0 -83
  53. data/lib/git-process/github_service.rb +0 -174
  54. data/spec/github_service_spec.rb +0 -211
@@ -15,7 +15,7 @@ require 'git-process/git_process_error'
15
15
  module GitProc
16
16
 
17
17
  class UncommittedChangesError < GitProcessError
18
- def initialize()
18
+ def initialize
19
19
  super("There are uncommitted changes.\nPlease either commit your changes, or use 'git stash' to set them aside.")
20
20
  end
21
21
  end
@@ -13,8 +13,8 @@
13
13
  module GitProc
14
14
  module Version
15
15
  MAJOR = 1
16
- MINOR = 0
17
- PATCH = 11
16
+ MINOR = 1
17
+ PATCH = 0
18
18
  BUILD = nil
19
19
 
20
20
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
@@ -1,23 +1,42 @@
1
+ require 'tmpdir'
1
2
  require 'FileHelpers'
2
3
  require 'git-process/git_process'
4
+ include GitProc
3
5
 
4
6
  module GitRepoHelper
5
7
 
6
8
  def gitprocess
7
- opts = {}
8
- opts[:quiet] = true if log_level == Logger::ERROR
9
- opts[:verbose] = true if log_level == Logger::DEBUG
10
- @gitprocess ||= create_process(tmpdir, opts)
9
+ if @gitprocess.nil? and respond_to?(:create_process)
10
+ @gitprocess = create_process(gitlib, :log_level => log_level)
11
+ end
12
+ @gitprocess
13
+ end
14
+
15
+
16
+ def gitlib
17
+ if @gitlib.nil?
18
+ if @gitprocess.nil?
19
+ @gitlib = create_gitlib(Dir.mktmpdir, :log_level => log_level)
20
+ else
21
+ @gitlib = gitprocess.gitlib
22
+ end
23
+ end
24
+ @gitlib
11
25
  end
12
26
 
13
27
 
14
- def tmpdir
15
- @tmpdir ||= Dir.mktmpdir
28
+ def config
29
+ gitlib.config
30
+ end
31
+
32
+
33
+ def remote
34
+ gitlib.remote
16
35
  end
17
36
 
18
37
 
19
38
  def commit_count
20
- gitprocess.log_count
39
+ gitlib.log_count
21
40
  end
22
41
 
23
42
 
@@ -27,55 +46,60 @@ module GitRepoHelper
27
46
 
28
47
 
29
48
  def logger
30
- gitprocess.logger
49
+ gitlib.logger
31
50
  end
32
51
 
33
52
 
34
53
  def create_files(file_names)
35
- Dir.chdir(gitprocess.workdir) do |dir|
54
+ GitRepoHelper.create_files gitlib, file_names
55
+ end
56
+
57
+
58
+ def self.create_files(gitlib, file_names)
59
+ Dir.chdir(gitlib.workdir) do |dir|
36
60
  file_names.each do |fn|
37
- gitprocess.logger.debug { "Creating #{dir}/#{fn}" }
61
+ gitlib.logger.debug { "Creating #{dir}/#{fn}" }
38
62
  FileUtils.touch fn
39
63
  end
40
64
  end
41
- gitprocess.add(file_names)
65
+ gitlib.add(file_names)
42
66
  end
43
67
 
44
68
 
45
- def change_file(filename, contents, lib = gitprocess)
69
+ def change_file(filename, contents, lib = gitlib)
46
70
  Dir.chdir(lib.workdir) do
47
71
  File.open(filename, 'w') { |f| f.puts contents }
48
72
  end
49
73
  end
50
74
 
51
75
 
52
- def change_file_and_add(filename, contents, lib = gitprocess)
76
+ def change_file_and_add(filename, contents, lib = gitlib)
53
77
  change_file(filename, contents, lib)
54
78
  lib.add(filename)
55
79
  end
56
80
 
57
81
 
58
- def change_file_and_commit(filename, contents, lib = gitprocess)
82
+ def change_file_and_commit(filename, contents, lib = gitlib)
59
83
  change_file_and_add(filename, contents, lib)
60
84
  lib.commit("#{filename} - #{contents}")
61
85
  end
62
86
 
63
87
 
64
- def create_process(dir, opts)
65
- GitProc::Process.new(dir, opts)
88
+ def create_gitlib(dir, opts)
89
+ git_lib = GitLib.new(dir, opts)
90
+ git_lib.config['user.email'] = 'test.user@test.com'
91
+ git_lib.config['user.name'] = 'test user'
92
+ git_lib
66
93
  end
67
94
 
68
95
 
69
- def clone(branch='master', remote_name = 'origin', &block)
96
+ def clone_repo(branch='master', remote_name = 'origin', &block)
70
97
  td = Dir.mktmpdir
71
98
 
72
- logger.debug { "Cloning '#{tmpdir}' to '#{td}'" }
99
+ logger.debug { "Cloning '#{gitlib.workdir}' to '#{td}'" }
73
100
 
74
- opts = {}
75
- opts[:quiet] = true if log_level == Logger::ERROR
76
- opts[:verbose] = true if log_level == Logger::DEBUG
77
- gl = create_process(td, opts)
78
- gl.add_remote(remote_name, "file://#{tmpdir}")
101
+ gl = create_gitlib(td, :log_level => logger.level)
102
+ gl.remote.add(remote_name, "file://#{gitlib.workdir}")
79
103
  gl.fetch(remote_name)
80
104
 
81
105
  if branch == 'master'
@@ -87,9 +111,8 @@ module GitRepoHelper
87
111
  if block_given?
88
112
  begin
89
113
  block.arity < 1 ? gl.instance_eval(&block) : block.call(gl)
90
- rescue => exp
114
+ ensure
91
115
  rm_rf(gl.workdir)
92
- raise exp
93
116
  end
94
117
  nil
95
118
  else
@@ -1,58 +1,39 @@
1
1
  require 'git-process/sync'
2
- require 'GitRepoHelper'
3
-
4
- module GitProc
5
-
6
- class CFHStub < Process
7
- include ChangeFileHelper
8
-
9
-
10
- def cleanup
11
- stash_pop if @stash_pushed
12
- end
13
-
14
- end
15
-
16
- end
17
-
18
-
19
- describe GitProc::ChangeFileHelper do
20
- include GitRepoHelper
21
-
22
- before(:each) do
23
- create_files(%w(.gitignore))
24
- gitprocess.commit('initial')
25
- end
26
-
27
-
28
- after(:each) do
29
- rm_rf(tmpdir)
30
- end
2
+ include GitProc
31
3
 
4
+ describe ChangeFileHelper, :git_repo_helper do
32
5
 
33
6
  def log_level
34
7
  Logger::ERROR
35
8
  end
36
9
 
37
10
 
11
+ #noinspection RubyUnusedLocalVariable
38
12
  def create_process(dir, opts)
39
- GitProc::CFHStub.new(dir, opts)
13
+ nil
40
14
  end
41
15
 
42
16
 
43
- describe "uncommitted changes" do
17
+ describe 'uncommitted changes' do
44
18
 
45
19
  it 'should fail when there are unmerged files' do
46
20
  change_file_and_commit('modified file.txt', 'start')
47
21
 
48
- gp = clone
49
- change_file_and_commit('modified file.txt', 'changed', gp)
50
- change_file_and_commit('modified file.txt', 'conflict', gitprocess)
51
- gp.fetch
22
+ clone_repo do |gl|
23
+ change_file_and_commit('modified file.txt', 'changed', gl)
24
+ change_file_and_commit('modified file.txt', 'conflict', gitlib)
25
+ gl.fetch
26
+
27
+ gl.merge('origin/master') rescue ''
28
+
29
+ change_file_helper = ChangeFileHelper.new(gl)
30
+ expect { change_file_helper.offer_to_help_uncommitted_changes }.to raise_error GitProc::UncommittedChangesError
31
+ end
32
+ end
52
33
 
53
- gp.merge('origin/master') rescue ''
54
34
 
55
- expect { gp.offer_to_help_uncommitted_changes }.should raise_error GitProc::UncommittedChangesError
35
+ def change_file_helper
36
+ @change_file_helper ||= ChangeFileHelper.new(gitlib)
56
37
  end
57
38
 
58
39
 
@@ -60,23 +41,23 @@ describe GitProc::ChangeFileHelper do
60
41
 
61
42
  before(:each) do
62
43
  change_file('unknown file.txt', '')
63
- gitprocess.stub(:say)
44
+ change_file_helper.stub(:say)
64
45
  end
65
46
 
66
47
 
67
48
  it 'should then add it' do
68
- gitprocess.stub(:ask).and_return('a')
69
- gitprocess.should_receive(:add).with(['unknown file.txt'])
49
+ ChangeFileHelper.stub(:ask_how_to_handle_unknown_files).and_return(:add)
50
+ change_file_helper.gitlib.should_receive(:add).with(['unknown file.txt'])
70
51
 
71
- gitprocess.offer_to_help_uncommitted_changes
52
+ change_file_helper.offer_to_help_uncommitted_changes
72
53
  end
73
54
 
74
55
 
75
56
  it 'should ignore the file' do
76
- gitprocess.stub(:ask).and_return('i')
77
- gitprocess.should_not_receive(:add)
57
+ ChangeFileHelper.stub(:ask_how_to_handle_unknown_files).and_return(:ignore)
58
+ change_file_helper.should_not_receive(:add)
78
59
 
79
- gitprocess.offer_to_help_uncommitted_changes
60
+ change_file_helper.offer_to_help_uncommitted_changes
80
61
  end
81
62
 
82
63
  end
@@ -97,9 +78,9 @@ describe GitProc::ChangeFileHelper do
97
78
  change_file('modified file2.txt', 'modified again')
98
79
  change_file_and_add('removed file2.txt', 'content')
99
80
  change_file_and_add('modified file4.txt', 'content')
100
- File.delete(File.join(gitprocess.workdir, 'removed file.txt'))
101
- File.delete(File.join(gitprocess.workdir, 'removed file2.txt'))
102
- File.delete(File.join(gitprocess.workdir, 'modified file3.txt'))
81
+ File.delete(File.join(gitlib.workdir, 'removed file.txt'))
82
+ File.delete(File.join(gitlib.workdir, 'removed file2.txt'))
83
+ File.delete(File.join(gitlib.workdir, 'modified file3.txt'))
103
84
 
104
85
  # End state of the above is:
105
86
  # A "added file.txt"
@@ -110,30 +91,30 @@ describe GitProc::ChangeFileHelper do
110
91
  # D "removed file.txt"
111
92
  # AD "removed file2.txt"
112
93
 
113
- gitprocess.stub(:say)
94
+ change_file_helper.stub(:say)
114
95
  end
115
96
 
116
97
 
117
98
  it 'should ask about modified files, then commit them' do
118
- gitprocess.stub(:ask).and_return('c')
119
- gitprocess.should_receive(:add).with(["added file.txt", "modified file.txt", "modified file2.txt", "modified file4.txt"])
120
- gitprocess.should_receive(:remove).with(["modified file3.txt", "removed file.txt", "removed file2.txt"])
121
- gitprocess.should_receive(:commit).with(nil)
99
+ ChangeFileHelper.stub(:ask_how_to_handle_changed_files).and_return(:commit)
100
+ gitlib.should_receive(:add).with(["added file.txt", "modified file.txt", "modified file2.txt", "modified file4.txt"])
101
+ gitlib.should_receive(:remove).with(["modified file3.txt", "removed file.txt", "removed file2.txt"])
102
+ gitlib.should_receive(:commit).with(nil)
122
103
 
123
- gitprocess.offer_to_help_uncommitted_changes
104
+ change_file_helper.offer_to_help_uncommitted_changes
124
105
  end
125
106
 
126
107
 
127
108
  it 'should ask about modified files, then stash them' do
128
- gitprocess.stub(:ask).and_return('s')
109
+ ChangeFileHelper.stub(:ask_how_to_handle_changed_files).and_return(:stash)
129
110
 
130
- gitprocess.offer_to_help_uncommitted_changes
111
+ change_file_helper.offer_to_help_uncommitted_changes
131
112
 
132
- gitprocess.status.clean?.should be_true
113
+ gitlib.status.clean?.should be_true
133
114
 
134
- gitprocess.cleanup
115
+ gitlib.stash_pop
135
116
 
136
- stat = gitprocess.status
117
+ stat = gitlib.status
137
118
  stat.added.should == ["added file.txt", "removed file2.txt"]
138
119
  stat.modified.should == ["modified file.txt", "modified file2.txt", "modified file4.txt"]
139
120
  stat.deleted.should == ["modified file3.txt", "removed file.txt"]
@@ -1,38 +1,42 @@
1
1
  require 'git-process/git_abstract_merge_error_builder'
2
+ require 'git-process/git_lib'
3
+ require 'FileHelpers'
2
4
 
3
5
  describe GitProc::AbstractMergeErrorBuilder do
4
6
 
5
7
  def builder
6
- unless @builder
7
- @builder = Object.new
8
- @builder.extend(GitProc::AbstractMergeErrorBuilder)
9
- @builder.stub(:lib).and_return(lib)
10
- @builder.stub(:continue_command).and_return(nil)
11
- @builder.stub(:error_message).and_return('')
12
- end
13
- @builder
8
+ @builder ||= GitProc::AbstractMergeErrorBuilder.new(gitlib, '', nil)
9
+ end
10
+
11
+
12
+ after(:each) do
13
+ rm_rf(gitlib.workdir)
14
14
  end
15
15
 
16
16
 
17
- def lib
18
- unless @lib
19
- @lib = double('lib')
20
- @lib.stub(:rerere_enabled?).and_return(true)
21
- @lib.stub(:rerere_autoupdate?).and_return(true)
22
- @lib.stub(:status).and_return(status)
17
+ def gitlib
18
+ if @lib.nil?
19
+ @lib = GitProc::GitLib.new(Dir.mktmpdir, :log_level => Logger::ERROR)
20
+ @lib.config.rerere_enabled = true
21
+ @lib.config.rerere_autoupdate = true
22
+ mock_status(@lib)
23
23
  end
24
24
  @lib
25
25
  end
26
26
 
27
27
 
28
- def status
29
- unless @status
30
- @status = double('status')
31
- @status.stub(:unmerged).and_return([])
32
- @status.stub(:modified).and_return([])
33
- @status.stub(:added).and_return([])
28
+ def metaclass(obj)
29
+ class << obj
30
+ self
31
+ end
32
+ end
33
+
34
+
35
+ def mock_status(lib)
36
+ spec = self
37
+ metaclass(lib).send(:define_method, :status) do
38
+ @status ||= spec.double('status')
34
39
  end
35
- @status
36
40
  end
37
41
 
38
42
 
@@ -46,9 +50,10 @@ describe GitProc::AbstractMergeErrorBuilder do
46
50
 
47
51
 
48
52
  it "merged with rerere.enabled false" do
49
- lib.stub(:rerere_enabled?).and_return(false)
50
- status.stub(:unmerged).and_return(['a', 'b c'])
51
- status.stub(:modified).and_return(['a', 'b c'])
53
+ gitlib.config.rerere_enabled = false
54
+ gitlib.status.stub(:unmerged).and_return(['a', 'b c'])
55
+ gitlib.status.stub(:modified).and_return(['a', 'b c'])
56
+ gitlib.status.stub(:added).and_return([])
52
57
 
53
58
  builder.resolved_files.should == []
54
59
  builder.unresolved_files.should == ['a', 'b c']
@@ -64,8 +69,11 @@ describe GitProc::AbstractMergeErrorBuilder do
64
69
 
65
70
 
66
71
  it "merged with rerere.enabled true and auto-handled AND autoupdated a file" do
67
- status.stub(:unmerged).and_return(['a', 'b c'])
68
- status.stub(:modified).and_return(['a', 'b c'])
72
+ gitlib.config.rerere_enabled = true
73
+ gitlib.config.rerere_autoupdate = true
74
+ gitlib.status.stub(:unmerged).and_return(['a', 'b c'])
75
+ gitlib.status.stub(:modified).and_return(['a', 'b c'])
76
+ gitlib.status.stub(:added).and_return([])
69
77
  builder.stub(:error_message).and_return("\nResolved 'a' using previous resolution.\n")
70
78
 
71
79
  builder.resolved_files.should == %w(a)
@@ -81,9 +89,10 @@ describe GitProc::AbstractMergeErrorBuilder do
81
89
 
82
90
 
83
91
  it "merged with rerere.enabled true and auto-handled and not autoupdated a file" do
84
- lib.stub(:rerere_autoupdate?).and_return(false)
85
- status.stub(:unmerged).and_return(['a', 'b c'])
86
- status.stub(:modified).and_return(['a', 'b c'])
92
+ gitlib.config.rerere_autoupdate = false
93
+ gitlib.status.stub(:unmerged).and_return(['a', 'b c'])
94
+ gitlib.status.stub(:modified).and_return(['a', 'b c'])
95
+ gitlib.status.stub(:added).and_return([])
87
96
  builder.stub(:error_message).and_return("\nResolved 'a' using previous resolution.\n")
88
97
 
89
98
  builder.resolved_files.should == %w(a)
@@ -100,10 +109,10 @@ describe GitProc::AbstractMergeErrorBuilder do
100
109
 
101
110
 
102
111
  it "merged with a file added in both branches" do
103
- lib.stub(:rerere_autoupdate?).and_return(false)
104
- status.stub(:unmerged).and_return(%w(a))
105
- status.stub(:modified).and_return(%w(b))
106
- status.stub(:added).and_return(%w(a c))
112
+ gitlib.config.rerere_autoupdate = false
113
+ gitlib.status.stub(:unmerged).and_return(%w(a))
114
+ gitlib.status.stub(:modified).and_return(%w(b))
115
+ gitlib.status.stub(:added).and_return(%w(a c))
107
116
 
108
117
  builder.resolved_files.should == %w()
109
118
  builder.unresolved_files.should == %w(a)
@@ -12,28 +12,28 @@ describe GitProc::GitBranch do
12
12
 
13
13
  before(:each) do
14
14
  create_files(%w(.gitignore))
15
- gitprocess.commit('initial')
15
+ gitlib.commit('initial')
16
16
  end
17
17
 
18
18
 
19
19
  after(:each) do
20
- rm_rf(@tmpdir)
20
+ rm_rf(gitlib.workdir)
21
21
  end
22
22
 
23
23
 
24
- describe "contains_all_of" do
24
+ describe 'contains_all_of' do
25
25
 
26
- it "should handle the trivial case" do
27
- current = gitprocess.branches.current
26
+ it 'should handle the trivial case' do
27
+ current = gitlib.branches.current
28
28
  current.contains_all_of(current.name).should == true
29
29
  end
30
30
 
31
31
 
32
- it "should handle new branch containing base branch that did not change" do
33
- base_branch = gitprocess.branches.current
32
+ it 'should handle new branch containing base branch that did not change' do
33
+ base_branch = gitlib.branches.current
34
34
 
35
- gitprocess.checkout('fb', :new_branch => base_branch.name)
36
- current = gitprocess.branches.current
35
+ gitlib.checkout('fb', :new_branch => base_branch.name)
36
+ current = gitlib.branches.current
37
37
 
38
38
  change_file_and_commit('a', 'hello')
39
39
 
@@ -42,27 +42,27 @@ describe GitProc::GitBranch do
42
42
 
43
43
 
44
44
  it "should handle new branch containing base branch that did change" do
45
- base_branch = gitprocess.branches.current
45
+ base_branch = gitlib.branches.current
46
46
 
47
- gitprocess.checkout('fb', :new_branch => base_branch.name)
48
- current = gitprocess.branches.current
47
+ gitlib.checkout('fb', :new_branch => base_branch.name)
48
+ current = gitlib.branches.current
49
49
 
50
- gitprocess.checkout(base_branch.name)
50
+ gitlib.checkout(base_branch.name)
51
51
  change_file_and_commit('a', 'goodbye')
52
52
 
53
53
  current.contains_all_of(base_branch.name).should == false
54
54
  end
55
55
 
56
56
 
57
- it "should handle containing in both branches" do
58
- base_branch = gitprocess.branches.current
57
+ it 'should handle containing in both branches' do
58
+ base_branch = gitlib.branches.current
59
59
 
60
- gitprocess.checkout('fb', :new_branch => base_branch.name)
61
- current = gitprocess.branches.current
60
+ gitlib.checkout('fb', :new_branch => base_branch.name)
61
+ current = gitlib.branches.current
62
62
 
63
63
  change_file_and_commit('a', 'hello')
64
64
 
65
- gitprocess.checkout(base_branch.name)
65
+ gitlib.checkout(base_branch.name)
66
66
  change_file_and_commit('a', 'goodbye')
67
67
 
68
68
  current.contains_all_of(base_branch.name).should == false
@@ -74,16 +74,16 @@ describe GitProc::GitBranch do
74
74
  describe "is_ahead_of" do
75
75
 
76
76
  it "should handle the trivial case" do
77
- current = gitprocess.branches.current
77
+ current = gitlib.branches.current
78
78
  current.is_ahead_of(current.name).should == false # same is not "ahead of"
79
79
  end
80
80
 
81
81
 
82
82
  it "should handle new branch containing base branch that did not change" do
83
- base_branch = gitprocess.branches.current
83
+ base_branch = gitlib.branches.current
84
84
 
85
- gitprocess.checkout('fb', :new_branch => base_branch.name)
86
- current = gitprocess.branches.current
85
+ gitlib.checkout('fb', :new_branch => base_branch.name)
86
+ current = gitlib.branches.current
87
87
 
88
88
  change_file_and_commit('a', 'hello')
89
89
 
@@ -92,12 +92,12 @@ describe GitProc::GitBranch do
92
92
 
93
93
 
94
94
  it "should handle new branch containing base branch that did change" do
95
- base_branch = gitprocess.branches.current
95
+ base_branch = gitlib.branches.current
96
96
 
97
- gitprocess.checkout('fb', :new_branch => base_branch.name)
98
- current = gitprocess.branches.current
97
+ gitlib.checkout('fb', :new_branch => base_branch.name)
98
+ current = gitlib.branches.current
99
99
 
100
- gitprocess.checkout(base_branch.name)
100
+ gitlib.checkout(base_branch.name)
101
101
  change_file_and_commit('a', 'goodbye')
102
102
 
103
103
  current.is_ahead_of(base_branch.name).should == false
@@ -105,14 +105,14 @@ describe GitProc::GitBranch do
105
105
 
106
106
 
107
107
  it "should handle containing in both branches" do
108
- base_branch = gitprocess.branches.current
108
+ base_branch = gitlib.branches.current
109
109
 
110
- gitprocess.checkout('fb', :new_branch => base_branch.name)
111
- current = gitprocess.branches.current
110
+ gitlib.checkout('fb', :new_branch => base_branch.name)
111
+ current = gitlib.branches.current
112
112
 
113
113
  change_file_and_commit('a', 'hello')
114
114
 
115
- gitprocess.checkout(base_branch.name)
115
+ gitlib.checkout(base_branch.name)
116
116
  change_file_and_commit('a', 'goodbye')
117
117
 
118
118
  current.is_ahead_of(base_branch.name).should == false