Skip to content

Commit

Permalink
creating new wc commit when @ becomes immuable
Browse files Browse the repository at this point in the history
  • Loading branch information
tdaron committed May 1, 2024
1 parent e54e83b commit 2591ac4
Show file tree
Hide file tree
Showing 2 changed files with 333 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cli/src/cli_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1307,12 +1307,19 @@ See https://github.com/martinvonz/jj/blob/main/docs/working-copy.md#stale-workin

if self.may_update_working_copy {
if let Some(new_commit) = &maybe_new_wc_commit {
self.update_working_copy(ui, maybe_old_wc_commit.as_ref(), new_commit)?;
self.update_working_copy(ui, maybe_old_wc_commit.as_ref(), &new_commit)?;
} else {
// It seems the workspace was deleted, so we shouldn't try to
// update it.
}
}

let current_wc = self.repo().view().wc_commit_ids().get(self.workspace_id());
if let Some(wc) = current_wc {
if self.check_rewritable([wc]).is_err() {
// Here i should create a new commit.
}
}
let settings = &self.settings;
if settings.user_name().is_empty() || settings.user_email().is_empty() {
writeln!(
Expand Down
Loading

0 comments on commit 2591ac4

Please sign in to comment.