File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ impl Context {
18
18
return Ok ( ( ) ) ;
19
19
} ;
20
20
let mut token = github. token ( "rust-lang/rust" ) ?;
21
- let bump_commit = branchpoint ( & mut token, "master" ) ?;
21
+ let repo = token. repository ( ) ?;
22
+ let bump_commit = branchpoint ( & mut token, & repo. default_branch ) ?;
22
23
let prebump_sha = bump_commit. parents [ 0 ] . sha . clone ( ) ;
23
24
let beta_sha = token. get_ref ( "heads/beta" ) ?;
24
25
Original file line number Diff line number Diff line change @@ -411,6 +411,17 @@ impl RepositoryClient<'_> {
411
411
self . client . without_body ( ) . send_with_response :: < GitFile > ( )
412
412
}
413
413
414
+ /// Returns information about the current repository
415
+ pub ( crate ) fn repository ( & mut self ) -> anyhow:: Result < Repository > {
416
+ self . start_new_request ( ) ?;
417
+ self . client . get ( true ) ?;
418
+ self . client . url ( & format ! (
419
+ "https://api.github.com/repos/{repo}" ,
420
+ repo = self . repo,
421
+ ) ) ?;
422
+ self . client . without_body ( ) . send_with_response :: < Repository > ( )
423
+ }
424
+
414
425
pub ( crate ) fn merge_pr ( & mut self , pr : u32 ) -> anyhow:: Result < ( ) > {
415
426
self . start_new_request ( ) ?;
416
427
self . client . put ( true ) ?;
@@ -496,6 +507,11 @@ impl GitFile {
496
507
}
497
508
}
498
509
510
+ #[ derive( Debug , serde:: Deserialize ) ]
511
+ pub ( crate ) struct Repository {
512
+ pub ( crate ) default_branch : String
513
+ }
514
+
499
515
#[ derive( Copy , Clone ) ]
500
516
pub ( crate ) struct CreateTag < ' a > {
501
517
pub ( crate ) commit : & ' a str ,
You can’t perform that action at this time.
0 commit comments