Skip to content

Commit 8cd1f7c

Browse files
committed
Fix default branch resolve
1 parent 26f2cf1 commit 8cd1f7c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/github.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,9 @@ impl RepositoryClient<'_> {
419419
"https://api.github.com/repos/{repo}",
420420
repo = self.repo,
421421
))?;
422-
self.client.without_body().send_with_response::<Repository>()
422+
self.client
423+
.without_body()
424+
.send_with_response::<Repository>()
423425
}
424426

425427
pub(crate) fn merge_pr(&mut self, pr: u32) -> anyhow::Result<()> {
@@ -509,7 +511,7 @@ impl GitFile {
509511

510512
#[derive(Debug, serde::Deserialize)]
511513
pub(crate) struct Repository {
512-
pub(crate) default_branch: String
514+
pub(crate) default_branch: String,
513515
}
514516

515517
#[derive(Copy, Clone)]

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl Context {
114114
remote.connect(git2::Direction::Fetch)?;
115115

116116
let git_ref = match self.config.channel {
117-
Channel::Nightly => format!("refs/heads/{}", remote.default_branch()?.as_str().unwrap()),
117+
Channel::Nightly => remote.default_branch()?.as_str().unwrap().to_string(),
118118
Channel::Beta => "refs/heads/beta".to_string(),
119119
Channel::Stable => "refs/heads/stable".to_string(),
120120
};

0 commit comments

Comments
 (0)