Wait for remote worktree to catch up with host before mutating entries

This ensures that entries don't randomly re-appear on remote worktrees
due to observing an update too late. In fact, it ensures that the remote
worktree has the same starting state of the host before preemptively applying
the fs operation locally.
This commit is contained in:
Antonio Scandurra 2022-05-05 13:47:53 +02:00
parent ecb847a027
commit 6212f2fe30
6 changed files with 171 additions and 94 deletions

View file

@ -162,6 +162,7 @@ message UpdateWorktree {
string root_name = 3;
repeated Entry updated_entries = 4;
repeated uint64 removed_entries = 5;
uint64 scan_id = 6;
}
message CreateProjectEntry {
@ -184,6 +185,7 @@ message DeleteProjectEntry {
message ProjectEntryResponse {
Entry entry = 1;
uint64 worktree_scan_id = 2;
}
message AddProjectCollaborator {
@ -658,6 +660,7 @@ message Worktree {
repeated Entry entries = 3;
repeated DiagnosticSummary diagnostic_summaries = 4;
bool visible = 5;
uint64 scan_id = 6;
}
message File {