Skip to content

Added allow_unrelated_histories option support for pull #521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/git/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ def each_conflict(&block) # :yields: file, your_version, their_version
# @git.pull('upstream') # pulls from upstream/master
# @git.pull('upstream', 'develope') # pulls from upstream/develop
#
def pull(remote='origin', branch='master')
self.lib.pull(remote, branch)
def pull(remote='origin', branch='master', opts = {})
self.lib.pull(remote, branch, opts)
end

# returns an array of Git:Remote objects
Expand Down
9 changes: 7 additions & 2 deletions lib/git/lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -888,8 +888,13 @@ def push(remote, branch = 'master', opts = {})
end
end

def pull(remote='origin', branch='master')
command('pull', remote, branch)
def pull(remote='origin', branch='master', opts = {})

arr_opts = []
arr_opts << '--rebase' if opts[:rebase]
arr_opts << '--allow-unrelated-histories' if opts[:allow_unrelated_histories]

command('pull', remote, branch, arr_opts)
end

def tag_sha(tag_name)
Expand Down