File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -52,11 +52,10 @@ class RemotesViewModel {
5252 ungit . logger . debug ( 'remotes.fetch() triggered' ) ;
5353
5454 try {
55- const tagPromise = this . server . getPromise ( '/remote/tags ' , {
55+ await this . server . postPromise ( '/fetch ' , {
5656 path : this . repoPath ( ) ,
5757 remote : this . currentRemote ( ) ,
5858 } ) ;
59- programEvents . dispatch ( { event : 'remote-tags-update' , tags : await tagPromise } ) ;
6059 if ( ! this . server . isInternetConnected ) {
6160 this . server . isInternetConnected = true ;
6261 }
Original file line number Diff line number Diff line change @@ -516,7 +516,7 @@ exports.registerApi = (env) => {
516516 jw ( async ( req , res ) => {
517517 if ( req . query . remoteFetch ) {
518518 if ( res . setTimeout ) res . setTimeout ( tenMinTimeoutMs ) ;
519- await req . repo . remoteAllFetch ( ) . catch ( ( err ) => {
519+ await req . repo . remoteAllFetch ( config . autoPruneOnFetch ) . catch ( ( err ) => {
520520 console . warn ( 'ignoring fetch error' , err ) ;
521521 } ) ;
522522 }
Original file line number Diff line number Diff line change @@ -275,24 +275,25 @@ class NGWrap {
275275 */
276276 async remoteFetch ( remoteName , refs = null , prune ) {
277277 const remote = await this . r . getRemote ( remoteName ) . catch ( normalizeError ) ;
278- // TODO use credentialshelper
279278 await remote . fetch (
280279 refs ,
281280 {
282281 callbacks : {
283- credentials : ( url , userName ) => nodegit . Cred . sshKeyFromAgent ( userName ) ,
282+ // TODO use credentialshelper
283+ // @ts -ignore -- Credential does exist, bad typing
284+ credentials : ( url , userName ) => nodegit . Credential . sshKeyFromAgent ( userName ) ,
284285 } ,
285286 prune : prune ? nodegit . Fetch . PRUNE . GIT_FETCH_PRUNE : undefined ,
286287 } ,
287288 undefined
288289 ) ;
289290 }
290291
291- async remoteAllFetch ( ) {
292+ async remoteAllFetch ( prune ) {
292293 const remotes = await this . getRemotes ( ) ;
293294 // making calls serially as credential helpers may get confused to which cred to get.
294295 for ( const name of remotes ) {
295- await this . remoteFetch ( name ) ;
296+ await this . remoteFetch ( name , null , prune ) ;
296297 }
297298 }
298299
You can’t perform that action at this time.
0 commit comments