@@ -167,11 +167,9 @@ pub struct ArchivedGitWorktree {
/// Branch that was checked out in the worktree at archive time. `None` if
/// the worktree was in detached HEAD state, which isn't supported in Zed, but
/// could happen if the user made a detached one outside of Zed.
- /// If that branch is missing, we auto-generate an new branch name. If the branch already
- /// exists, we see if it points to our commit_hash~2 (~2 because commit_hash points to
- /// WIP commits we created to preserve uncommitted and staged files, respectively),
- /// and the branch does already point to that commit, then we use the branch as-is. If it
- /// already exists but it's pointing to a different commit, we auto-gen a new branch.
+ /// On restore, we try to switch to this branch. If that fails (e.g. it's
+ /// checked out elsewhere), we try to create it. If both fail, the restored
+ /// worktree stays in detached HEAD and a warning is logged.
pub branch_name: Option<String>,
/// SHA of the WIP commit that we made in order to save the files that were uncommitted
/// and unstaged at the time of archiving. This commit can be empty. Its parent commit
@@ -180,11 +178,9 @@ pub struct ArchivedGitWorktree {
/// past both of these commits, we're back in the state we had before archiving, including
/// what was staged, what was unstaged, and what was committed.
pub commit_hash: String,
- /// Whether this worktree has been restored by a prior unarchive. This is used when
- /// unarchiving multiple threads, and tells us whether to treat worktree_path's presence
- /// in the filesystem as a collision to be worked around (the directory was "taken" by
- /// something else while we were archived), or as a source of truth we can reuse for an
- /// unarchived thread instead of needing to create another directory.
+ /// Whether this worktree has been restored by a prior unarchive.
+ /// Currently unused — the record is deleted immediately after a
+ /// successful restore rather than being marked as restored.
pub restored: bool,
}