diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-01-23 00:00:00 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-01-23 00:00:00 +0000 |
| commit | 4604de9f25afe235678188e42f4e168587d8a3de (patch) | |
| tree | 57db05069a43d01aa42d4d62ac27c20f8c68943d | |
| parent | 7799b0edd16b0c97eb58ba2de62be27134a76122 (diff) | |
feat(pull): check for clean repo
before applying changes and bail if not
| -rw-r--r-- | src/sub_commands/pull.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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<()> { | |||
| 96 | .map(std::borrow::ToOwned::to_owned) | 96 | .map(std::borrow::ToOwned::to_owned) |
| 97 | .collect(); | 97 | .collect(); |
| 98 | 98 | ||
| 99 | // TODO: are there outstanding changes to prevent checking out a new branch? | 99 | if git_repo.has_outstanding_changes()? { |
| 100 | bail!("cannot pull changes when repository is not clean. discard changes and try again."); | ||
| 101 | } | ||
| 100 | 102 | ||
| 101 | let most_recent_pr_patch_chain = get_most_recent_patch_with_ancestors(commits_events) | 103 | let most_recent_pr_patch_chain = get_most_recent_patch_with_ancestors(commits_events) |
| 102 | .context("cannot get most recent patch for PR")?; | 104 | .context("cannot get most recent patch for PR")?; |