Skip to content

Commit 24b6467

Browse files
committed
Merge branch 'release/1.2.7'
2 parents 41d9e3e + 605a2f8 commit 24b6467

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

lib/git/base.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ def self.init(working_dir, opts = {})
5252
#
5353
def self.clone(repository, name, opts = {})
5454
# run git-clone
55-
self.new(Git::Lib.new.clone(repository, name, opts))
55+
logger = opts[:log]
56+
57+
self.new(Git::Lib.new(nil, logger).clone(repository, name, opts))
5658
end
5759

5860
def initialize(options = {})

lib/git/lib.rb

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,15 @@ def clone(repository, name, opts = {})
6161
arr_opts << "-o" << opts[:remote] if opts[:remote]
6262
arr_opts << "--depth" << opts[:depth].to_i if opts[:depth] && opts[:depth].to_i > 0
6363
arr_opts << "--config" << opts[:config] if opts[:config]
64+
arr_opts << "--mirror" if opts[:mirror]
6465

6566
arr_opts << '--'
6667
arr_opts << repository
6768
arr_opts << clone_dir
6869

6970
command('clone', arr_opts)
7071

71-
opts[:bare] ? {:repository => clone_dir} : {:working_directory => clone_dir}
72+
(opts[:bare] or opts[:mirror]) ? {:repository => clone_dir} : {:working_directory => clone_dir}
7273
end
7374

7475

@@ -226,7 +227,8 @@ def branches_all
226227
arr = []
227228
command_lines('branch', '-a').each do |b|
228229
current = (b[0, 2] == '* ')
229-
arr << [b.gsub('* ', '').strip, current]
230+
branch = b.gsub('* ', '').strip
231+
arr << [branch, current] unless branch == '(no branch)'
230232
end
231233
arr
232234
end
@@ -576,6 +578,15 @@ def remote_remove(name)
576578
command('remote', ['rm', name])
577579
end
578580

581+
def remote_update(opts={})
582+
remotes=opts.delete(:remotes)
583+
arr_opts = ['update']
584+
arr_opts << '-p' if opts[:prune]
585+
arr_opts.concat remotes if remotes
586+
587+
command('remote', arr_opts)
588+
end
589+
579590
def remotes
580591
command_lines('remote')
581592
end

lib/git/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ module Git
22

33
# The current gem version
44
# @return [String] the current gem version.
5-
VERSION='1.2.6'
5+
VERSION='1.2.7'
66

77
end

0 commit comments

Comments
 (0)