File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -38,15 +38,17 @@ public bool Force
3838 set => _repo . Settings . EnableForceOnFetch = value ;
3939 }
4040
41+ private bool _fetchPreferedRemote = false ;
42+
4143 public Fetch ( Repository repo , Models . Remote preferredRemote = null )
4244 {
4345 _repo = repo ;
44- // _fetchAllRemotes = preferredRemote == null;
4546 _fetchAllRemotes = _repo . Settings . FetchAllRemotes ;
4647
4748 if ( preferredRemote != null )
4849 {
4950 SelectedRemote = preferredRemote ;
51+ _fetchPreferedRemote = true ;
5052 }
5153 else if ( ! string . IsNullOrEmpty ( _repo . Settings . DefaultRemote ) )
5254 {
@@ -69,7 +71,7 @@ public override async Task<bool> Sure()
6971 var log = _repo . CreateLog ( "Fetch" ) ;
7072 Use ( log ) ;
7173
72- if ( all )
74+ if ( all && ! _fetchPreferedRemote )
7375 {
7476 foreach ( var remote in _repo . Remotes )
7577 await new Commands . Fetch ( _repo . FullPath , remote . Name , notags , force )
@@ -94,6 +96,7 @@ public override async Task<bool> Sure()
9496
9597 _repo . MarkFetched ( ) ;
9698 _repo . SetWatcherEnabled ( true ) ;
99+ _fetchPreferedRemote = false ;
97100 return true ;
98101 }
99102
You can’t perform that action at this time.
0 commit comments