Skip to content

Commit a0afc0e

Browse files
author
TJ Biddle
committed
Patch version bump. Git pull is a fetch and merge, but it needs to merge the remote - otherwise there is nothing to merge
1 parent a8de13e commit a0afc0e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
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.6"
8+
s.version = "1.2.7"
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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,10 @@ def each_conflict(&block) # :yields: file, your_version, their_version
322322
# fetches a branch from a remote and merges it into the current working branch
323323
def pull(remote = 'origin', branch = 'master', message = 'origin pull')
324324
fetch(remote)
325-
merge(branch, message)
325+
old_branch = self.lib.branch_current
326+
if self.lib.branch_current != branch then checkout(branch) end
327+
merge(remote, message)
328+
if self.lib.branch_current != branch then checkout(old_branch) end
326329
end
327330

328331
# returns an array of Git:Remote objects

0 commit comments

Comments
 (0)