Skip to content

Do not rollback branch state in case of a merge failure #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ This merge was created using https://github.com/rust-lang/josh-sync.

// Merge the fetched commit.
// It is useful to print stdout/stderr here, because it shows the git diff summary
stream_command(
if let Err(error) = stream_command(
&[
"git",
"merge",
Expand All @@ -189,7 +189,16 @@ This merge was created using https://github.com/rust-lang/josh-sync.
],
self.verbose,
)
.context("FAILED to merge new commits, something went wrong")?;
.context("FAILED to merge new commits, something went wrong")
{
eprintln!(
r"The merge was unsuccessful (maybe there was a conflict?).
NOT rolling back the branch state, so you can examine it manually.
After you fix the conflicts, `git add` the changes and run `git merge --continue`."
);
git_reset.disarm();
return Err(RustcPullError::PullFailed(error));
}

// Now detect if something has actually been pulled
let current_sha = get_current_head_sha(self.verbose)?;
Expand Down