From 4d8d545b8471cbf6260d930ee30ee3f0ae268a49 Mon Sep 17 00:00:00 2001 From: Michael Mallete Date: Thu, 23 May 2013 16:42:56 +0800 Subject: [PATCH 1/3] replace fetch + merge with git pull --- lib/git/base.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 From 42d0d130dceea265117b7e6a010cf1e776fcc6b6 Mon Sep 17 00:00:00 2001 From: Michael Mallete Date: Thu, 23 May 2013 16:44:56 +0800 Subject: [PATCH 2/3] to silence warning about misalignment of class-end declaration --- lib/git/path.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From a147c7740b1b73f46ae3663b87b986cec33777bc Mon Sep 17 00:00:00 2001 From: Michael Mallete Date: Fri, 24 May 2013 21:45:56 +0800 Subject: [PATCH 3/3] ooops missed to commit lib changes --- lib/git/lib.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)