fix(repo/branch): revalidate positions in more conditions
- when next has no commits - when couldn't reset next to a commit (e.g. commit was WIP)
This commit is contained in:
parent
0622e6092b
commit
4c4ac4df25
1 changed files with 5 additions and 9 deletions
|
@ -163,28 +163,24 @@ pub async fn advance_next(
|
|||
let next_commit = find_next_commit_on_dev(next, dev_commit_history);
|
||||
let Some(commit) = next_commit else {
|
||||
warn!("No commits to advance next to");
|
||||
revalidate_positions(addr).await;
|
||||
return;
|
||||
};
|
||||
if let Some(problem) = validate_commit_message(commit.message()) {
|
||||
warn!("Can't advance next to commit '{}': {}", commit, problem);
|
||||
revalidate_positions(addr).await;
|
||||
return;
|
||||
}
|
||||
info!("Advancing next to commit '{}'", commit);
|
||||
match git.reset(
|
||||
if let Err(err) = git.reset(
|
||||
&repo_config.branches().next(),
|
||||
commit.into(),
|
||||
ResetForce::None,
|
||||
&repo_details,
|
||||
) {
|
||||
Ok(_) => {
|
||||
// TODO : (#18) sleep and restart while we don't have webhooks
|
||||
tokio::time::sleep(std::time::Duration::from_secs(10)).await;
|
||||
addr.do_send(ValidateRepo);
|
||||
}
|
||||
Err(err) => {
|
||||
warn!(?err, "Failed")
|
||||
}
|
||||
};
|
||||
revalidate_positions(addr).await;
|
||||
}
|
||||
|
||||
#[tracing::instrument]
|
||||
|
|
Loading…
Reference in a new issue