mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-31 16:33:10 +00:00
cli: when importing Git HEAD, abandon right workspace's old commit (#13)
When importing Git HEAD, we already use the right workspace ID for the new checkout, but the old checkout we abandon is always the default workspace's. We should fix that even if we will never support sharing a working copy with Git in a non-default workspace.
This commit is contained in:
parent
48bbb3abc0
commit
72b5d9a8c5
1 changed files with 3 additions and 2 deletions
|
@ -286,8 +286,9 @@ impl WorkspaceCommandHelper {
|
||||||
if new_git_head != old_git_head && new_git_head.is_some() {
|
if new_git_head != old_git_head && new_git_head.is_some() {
|
||||||
let workspace_id = self.workspace.workspace_id();
|
let workspace_id = self.workspace.workspace_id();
|
||||||
let mut locked_working_copy = self.workspace.working_copy_mut().start_mutation();
|
let mut locked_working_copy = self.workspace.working_copy_mut().start_mutation();
|
||||||
tx.mut_repo()
|
if let Some(old_checkout) = self.repo.view().get_checkout(&workspace_id) {
|
||||||
.record_abandoned_commit(self.repo.view().checkout().clone());
|
tx.mut_repo().record_abandoned_commit(old_checkout.clone());
|
||||||
|
}
|
||||||
let new_checkout = self
|
let new_checkout = self
|
||||||
.repo
|
.repo
|
||||||
.store()
|
.store()
|
||||||
|
|
Loading…
Reference in a new issue