-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git: on export, use repo view's
git_refs
as record of old export state
@yuja asked on jj-vcs#701 about the difference between the state in the `git_export_view` and what we have in `mut_repo.view()`. It's true that the branches in `mut_repo.view().git_refs()` should match what we wrote to disk. We can therefore remove the on-disk storage and simplify quite a bit. For now, I create the `last_export_view` from the `mut_repo.view().git_refs()` before calling `export_changes()`. I'll clean up a bit more next. I think this is correct even considering e.g. undo. Let's consider what would happen in a non-colocated Git repo (not because tricky cases cannot happen there but because the explicit exports and imports make it easier to discuss, and more cases can occur). If the user moved a branch and then did `jj git export`, `jj undo`, and then `jj git export` again, we would think on the second export that we should perform the same changes to the Git repo, which should have no effect. This patch also fixes the bug we were forced to work around in the test case in the previous patch. This removes one of our uses of Thrift.
- Loading branch information
1 parent
3979236
commit 8a440d8
Showing
2 changed files
with
14 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters