From 4604de9f25afe235678188e42f4e168587d8a3de Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 23 Jan 2024 00:00:00 +0000 Subject: feat(pull): check for clean repo before applying changes and bail if not --- src/sub_commands/pull.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/sub_commands') diff --git a/src/sub_commands/pull.rs b/src/sub_commands/pull.rs index a656e09..70a015a 100644 --- a/src/sub_commands/pull.rs +++ b/src/sub_commands/pull.rs @@ -96,7 +96,9 @@ pub async fn launch() -> Result<()> { .map(std::borrow::ToOwned::to_owned) .collect(); - // TODO: are there outstanding changes to prevent checking out a new branch? + if git_repo.has_outstanding_changes()? { + bail!("cannot pull changes when repository is not clean. discard changes and try again."); + } let most_recent_pr_patch_chain = get_most_recent_patch_with_ancestors(commits_events) .context("cannot get most recent patch for PR")?; -- cgit v1.2.3