@@ -11,6 +11,7 @@ use serde::Deserialize;
11
11
use std:: env;
12
12
use std:: fs;
13
13
use std:: path:: { Path , PathBuf } ;
14
+ use std:: process:: Command ;
14
15
15
16
#[ cfg( target_os = "macos" ) ]
16
17
use crate :: launchctl;
@@ -282,13 +283,26 @@ fn fetch_repo_info(repo: &git2::Repository) -> git2::MergeAnalysis {
282
283
true
283
284
} ) ;
284
285
285
- remote
286
- . fetch (
287
- & [ "main" ] ,
288
- Some ( FetchOptions :: new ( ) . remote_callbacks ( callbacks) ) ,
289
- None ,
290
- )
291
- . nice_unwrap ( "Could not fetch latest update" ) ;
286
+ let res = remote. fetch (
287
+ & [ "main" ] ,
288
+ Some ( FetchOptions :: new ( ) . remote_callbacks ( callbacks) ) ,
289
+ None ,
290
+ ) ;
291
+ if res. as_ref ( ) . is_err_and ( |e| {
292
+ e. message ( )
293
+ . contains ( "authentication required but no callback set" )
294
+ } ) {
295
+ // Setting the authentication callback is kinda jank, just call the git process lmao
296
+ Command :: new ( "git" )
297
+ . args ( & [ "fetch" , "origin" , "main" ] )
298
+ . current_dir ( Config :: sdk_path ( ) )
299
+ . spawn ( )
300
+ . nice_unwrap ( "Could not fetch latest update" )
301
+ . wait ( )
302
+ . nice_unwrap ( "Could not fetch latest update" ) ;
303
+ } else {
304
+ res. nice_unwrap ( "Could not fetch latest update" ) ;
305
+ }
292
306
293
307
// Check if can fast-forward
294
308
let fetch_head = repo. find_reference ( "FETCH_HEAD" ) . unwrap ( ) ;
@@ -414,7 +428,6 @@ fn switch_to_tag(config: &mut Config, repo: &Repository) {
414
428
}
415
429
416
430
fn install_binaries ( config : & mut Config , platform : Option < String > ) {
417
- update ( config, None ) ;
418
431
let release_tag: String ;
419
432
let target_dir: PathBuf ;
420
433
if config. sdk_nightly {
0 commit comments