File tree Expand file tree Collapse file tree 3 files changed +8
-17
lines changed Expand file tree Collapse file tree 3 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,6 @@ def setup
7
7
8
8
if git_creds?
9
9
def test_fetch_over_git
10
- reset_remote_repo
11
-
12
10
@repo . remotes . create ( "origin" , ENV [ 'GITTEST_REMOTE_GIT_URL' ] )
13
11
14
12
@repo . fetch ( "origin" )
@@ -34,8 +32,6 @@ def test_fetch_over_https
34
32
35
33
if Rugged . features . include? ( :ssh ) && ssh_creds?
36
34
def test_fetch_over_ssh_with_credentials
37
- reset_remote_repo
38
-
39
35
@repo . remotes . create ( "origin" , ENV [ 'GITTEST_REMOTE_SSH_URL' ] )
40
36
41
37
@repo . fetch ( "origin" , {
@@ -44,8 +40,6 @@ def test_fetch_over_ssh_with_credentials
44
40
end
45
41
46
42
def test_fetch_over_ssh_with_credentials_from_agent
47
- reset_remote_repo
48
-
49
43
@repo . remotes . create ( "origin" , ENV [ 'GITTEST_REMOTE_SSH_URL' ] )
50
44
51
45
@repo . fetch ( "origin" , {
@@ -54,8 +48,6 @@ def test_fetch_over_ssh_with_credentials_from_agent
54
48
end
55
49
56
50
def test_fetch_over_ssh_with_credentials_callback
57
- reset_remote_repo
58
-
59
51
@repo . remotes . create ( "origin" , ENV [ 'GITTEST_REMOTE_SSH_URL' ] )
60
52
61
53
@repo . fetch ( "origin" , {
Original file line number Diff line number Diff line change @@ -25,8 +25,6 @@ def test_ls_over_https
25
25
26
26
if git_creds?
27
27
def test_ls_over_git
28
- reset_remote_repo
29
-
30
28
remote = @repo . remotes . create ( "origin" , ENV [ 'GITTEST_REMOTE_GIT_URL' ] )
31
29
remote . push ( [ "refs/heads/b1:refs/heads/b1" ] )
32
30
@@ -38,8 +36,6 @@ def test_ls_over_git
38
36
39
37
if Rugged . features . include? ( :ssh ) && ssh_creds?
40
38
def test_ls_over_ssh_with_credentials
41
- reset_remote_repo
42
-
43
39
remote = @repo . remotes . create ( "origin" , ENV [ 'GITTEST_REMOTE_SSH_URL' ] )
44
40
remote . push ( [ "refs/heads/b1:refs/heads/b1" ] , credentials : ssh_key_credential )
45
41
Original file line number Diff line number Diff line change @@ -100,12 +100,15 @@ def self.with_cleanup(repo, path)
100
100
end
101
101
102
102
class OnlineTestCase < TestCase
103
- def reset_remote_repo
104
- remote_repo = Rugged ::Repository . new ( ENV [ 'GITTEST_REMOTE_REPO_PATH' ] )
105
- remote_repo . references . each do |ref |
106
- remote_repo . references . delete ( ref )
103
+ if ENV [ 'GITTEST_REMOTE_REPO_PATH' ]
104
+ def before_setup
105
+ remote_repo = Rugged ::Repository . new ( ENV [ 'GITTEST_REMOTE_REPO_PATH' ] )
106
+ remote_repo . references . each do |ref |
107
+ remote_repo . references . delete ( ref )
108
+ end
109
+
110
+ super
107
111
end
108
- remote_repo . close
109
112
end
110
113
111
114
def self . ssh_creds?
You can’t perform that action at this time.
0 commit comments