diff --git a/lib/git/base.rb b/lib/git/base.rb index dd9b6bb7..61761f6e 100644 --- a/lib/git/base.rb +++ b/lib/git/base.rb @@ -332,9 +332,8 @@ def each_conflict(&block) # :yields: file, your_version, their_version end # fetches a branch from a remote and merges it into the current working branch - def pull(remote = 'origin', branch = 'master', message = 'origin pull') - fetch(remote) - merge(branch, message) + def pull(remote = 'origin', branch = 'master') + self.lib.pull(remote, branch) end # returns an array of Git:Remote objects diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 21de727a..3fce1c65 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -541,7 +541,11 @@ def push(remote, branch = 'master', tags = false) command('push', [remote, branch]) command('push', ['--tags', remote]) if tags end - + + def pull(remote = 'origin', branch = 'master') + command('pull', [remote, branch]) + end + def tag_sha(tag_name) head = File.join(@git_dir, 'refs', 'tags', tag_name) return File.read(head).chomp if File.exists?(head) diff --git a/lib/git/path.rb b/lib/git/path.rb index 22473a20..b78553ef 100644 --- a/lib/git/path.rb +++ b/lib/git/path.rb @@ -24,6 +24,6 @@ def to_s @path end - end + end end