Skip to content

Commit 35e10d6

Browse files
Adding :config support to Lib#clone
Using :config => receive.denyCurrentBranch=ignore for remote repo on push tests (failing on Git 1.7)
1 parent 612d673 commit 35e10d6

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ require 'rubygems'
33

44
require "#{File.expand_path(File.dirname(__FILE__))}/lib/git/version"
55

6+
task :default => :test
7+
68
desc "Upload Docs"
79
task :upload_docs do |t|
810
system('rsync -rv --delete doc/ git.rubyforge.org:/var/www/gforge-projects/git')

lib/git/lib.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def clone(repository, name, opts = {})
4949
arr_opts << "--bare" if opts[:bare]
5050
arr_opts << "-o" << opts[:remote] if opts[:remote]
5151
arr_opts << "--depth" << opts[:depth].to_i if opts[:depth] && opts[:depth].to_i > 0
52+
arr_opts << "--config" << opts[:config] if opts[:config]
5253

5354
arr_opts << '--'
5455
arr_opts << repository

tests/units/test_remotes.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_remote_fun
4545
def test_push
4646
in_temp_dir do |path|
4747
loc = Git.clone(@wbare, 'local')
48-
rem = Git.clone(@wbare, 'remote')
48+
rem = Git.clone(@wbare, 'remote', :config => 'receive.denyCurrentBranch=ignore')
4949

5050
r = loc.add_remote('testrem', rem)
5151

@@ -63,7 +63,7 @@ def test_push
6363
end
6464
assert(!rem.status['test-file1'])
6565
assert(!rem.status['test-file3'])
66-
66+
6767
loc.push('testrem')
6868

6969
assert(rem.status['test-file1'])
@@ -82,4 +82,4 @@ def test_push
8282
end
8383

8484

85-
end
85+
end

0 commit comments

Comments
 (0)