1
- using System ;
2
- using System . ComponentModel . DataAnnotations ;
1
+ using System . ComponentModel . DataAnnotations ;
3
2
using System . IO ;
4
3
using System . Threading . Tasks ;
5
4
@@ -45,12 +44,6 @@ public string SSHKey
45
44
set => SetProperty ( ref _sshkey , value , true ) ;
46
45
}
47
46
48
- public bool PruneTagsOnFetch
49
- {
50
- get ;
51
- set ;
52
- }
53
-
54
47
public EditRemote ( Repository repo , Models . Remote remote )
55
48
{
56
49
_repo = repo ;
@@ -59,11 +52,8 @@ public EditRemote(Repository repo, Models.Remote remote)
59
52
_url = remote . URL ;
60
53
_useSSH = Models . Remote . IsSSH ( remote . URL ) ;
61
54
62
- var config = new Commands . Config ( repo . FullPath ) ;
63
55
if ( _useSSH )
64
- _sshkey = config . Get ( $ "remote.{ remote . Name } .sshkey") ;
65
-
66
- PruneTagsOnFetch = config . Get ( $ "remote.{ remote . Name } .pruneTags") . Equals ( "true" , StringComparison . OrdinalIgnoreCase ) ;
56
+ _sshkey = new Commands . Config ( repo . FullPath ) . Get ( $ "remote.{ remote . Name } .sshkey") ;
67
57
}
68
58
69
59
public static ValidationResult ValidateRemoteName ( string name , ValidationContext ctx )
@@ -131,9 +121,7 @@ public override async Task<bool> Sure()
131
121
if ( pushURL != _url )
132
122
await new Commands . Remote ( _repo . FullPath ) . SetURLAsync ( _name , _url , true ) ;
133
123
134
- var config = new Commands . Config ( _repo . FullPath ) ;
135
- await config . SetAsync ( $ "remote.{ _name } .sshkey", _useSSH ? SSHKey : null ) ;
136
- await config . SetAsync ( $ "remote.{ _name } .pruneTags", PruneTagsOnFetch ? "true" : null ) ;
124
+ await new Commands . Config ( _repo . FullPath ) . SetAsync ( $ "remote.{ _name } .sshkey", _useSSH ? SSHKey : null ) ;
137
125
138
126
_repo . SetWatcherEnabled ( true ) ;
139
127
return true ;
0 commit comments