Allow providing a branch name in generator

This commit is contained in:
Valentin Brandl
2022-08-18 14:07:07 +02:00
parent ecbc63f522
commit dbbbdad3fa
3 changed files with 11 additions and 3 deletions

View File

@ -55,6 +55,7 @@ struct GeneratorForm<'a> {
service: FormService,
user: Cow<'a, str>,
repo: Cow<'a, str>,
branch: Option<Cow<'a, str>>,
}
#[derive(Debug)]
@ -447,6 +448,11 @@ async fn generate(
params.service.url(),
params.service.service(),
&repo,
params
.branch
.as_deref()
.filter(|s| !s.is_empty())
.unwrap_or("master"),
)?;
Ok(HttpResponse::Ok().content_type("text/html").body(buf))