Skip to content

Commit 129e798

Browse files
author
TJ Biddle
committed
Updating pull method to do a normal git pull with it's remove and branch specified rather than do a fetch and merge.
1 parent 56300bf commit 129e798

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

git.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Gem::Specification.new do |s|
77
s.name = %q{git}
8-
s.version = "1.2.7"
8+
s.version = "1.2.9"
99

1010
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
1111
s.authors = ["Scott Chacon"]

lib/git/base.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,8 @@ def each_conflict(&block) # :yields: file, your_version, their_version
320320
end
321321

322322
# fetches a branch from a remote and merges it into the current working branch
323-
def pull(remote = 'origin', branch = 'master', message = 'origin pull')
324-
fetch(remote)
325-
merge(remote, message)
323+
def pull(remote = 'origin', branch = 'master')
324+
self.lib.pull(remote, branch)
326325
end
327326

328327
# returns an array of Git:Remote objects

lib/git/lib.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,10 @@ def merge(branch, message = nil, arr_opts = [])
507507
command('merge', arr_opts)
508508
end
509509

510+
def pull(remote, branch)
511+
command('pull', [remote, branch])
512+
end
513+
510514
def unmerged
511515
unmerged = []
512516
command_lines('diff', ["--cached"]).each do |line|

0 commit comments

Comments
 (0)