Skip to content

Commit

Permalink
it's actually more correct to un-mark-delete by *un*tracking; the sta…
Browse files Browse the repository at this point in the history
…te is one of tracking absence
  • Loading branch information
gulbanana committed Mar 23, 2024
1 parent f577b7d commit 34e1843
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ local branch and the tracked remote branches with which it is currently synced a
a single UI object. Remote branches are displayed separately if they're unsynced, untracked or absent.

Consequently, the commands available for a branch as displayed in the UI have polymorphic effect:
1) "Track": Applies to any remote branch that is not unsynced (and therefore already tracked);
in the CLI-only "tracking ref absent" state, this will effectively cancel its pending deletion.
1) "Track": Applies to any remote branch that is not already tracked.
2) "Untrack":
- For a *tracking local/combined branch*, untracks all remotes.
- For an *unsynced remote branch*, untracks one remote.
- For a *deleting remote branch*, clears the pending delete (it was tracking absence).
3) "Push": Applies to local branches tracking any remotes.
4) "Push to remote...": Applies to local branches when any remotes exist.
5) "Fetch": Downloads for a specific branch only.
Expand Down
6 changes: 1 addition & 5 deletions src-tauri/src/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,6 @@ pub fn handle_context(window: Window, ctx: Operand) -> Result<()> {
StoreRef::RemoteBranch {
is_tracked: false,
..
} | StoreRef::RemoteBranch {
is_absent: true,
..
}
),
)?;
Expand All @@ -364,8 +361,7 @@ pub fn handle_context(window: Window, ctx: Operand) -> Result<()> {
r#ref,
StoreRef::RemoteBranch {
is_synced: false, // we can *see* the remote ref, and
is_tracked: true, // it has a local, and
is_absent: false, // that local is somewhere else
is_tracked: true, // it has a local (regardless of absence)
..
}
),
Expand Down

0 comments on commit 34e1843

Please sign in to comment.