Allow users to customize the default branch name #5

Merged
cadey merged 3 commits from customizable-branch-name into master 2020-06-12 11:18:14 +00:00
4 changed files with 19 additions and 17 deletions
Showing only changes of commit afef05b54d - Show all commits

View File

@ -74,6 +74,9 @@ mod tests {
let res = super::read("testdata/basic.md".into(), "0.1.0".into());
assert!(res.is_ok());
let delta = res.unwrap();
assert_eq!(delta, "Hi there this is a test\\!\n### ADDED\n - something\n")
assert_eq!(
delta,
"Hi there this is a test\\!\n### ADDED\n - something\n"
)
}
}

View File

@ -9,7 +9,8 @@ pub(crate) async fn run(env: DroneEnv) -> Result<()> {
let default_branch = match &env.default_branch {
None => {
let cli = crate::client(&common)?;
let repo = crate::gitea::get_repo(&cli, &common.server, &common.owner, &common.repo).await?;
let repo =
crate::gitea::get_repo(&cli, &common.server, &common.owner, &common.repo).await?;
repo.default_branch
}
Some(branch) => branch.to_string(),

View File

@ -32,12 +32,10 @@ pub(crate) async fn run(
cr.prerelease = rm.pre_release;
let resp = cli
.post(
&format!(
.post(&format!(
"{}/api/v1/repos/{}/{}/releases/{}",
common.server, common.owner, common.repo, release.id
),
)
))
.json(&cr)
.send()
.await?;