Repository navigation
Add Fetch and Prune menu items - #572
Merged
Merged
Conversation
Let the fetch action accept remote-branch refs, so the menu item does what its title already promises. - Right-clicking a remote branch offers an enabled Fetch "origin", since the item is gated on the ref having a remote name, but fetchRemote: only accepted branch and remote refishes. A remote branch reports its own refish type, so refishForSender: returned nil and the action bailed out with no fetch, no sheet and no error. The Repository menu fails the same way, as selectedRef only rewrites a row to its remote when the row sits directly under Remotes. - Accept kGitXRemoteBranchType as well. Everything downstream already copes with these refs and resolves them to their remote name.
Expose 'prune' as a command of its own, so a one-off prune no longer means flipping the global preference back and forth. - Offer 'Fetch "origin" and Prune' in the ref context menus, right after the plain fetch item, and add 'Fetch and Prune' plus 'Fetch All and Prune' to the Repository menu. - Thread a force-prune override down to the fetch task. An explicit invocation passes '--prune' in every preference state, including "Never prune", since a deliberate action should beat a default. - Cover the resulting argument matrix in GitXTests, which needs the app's prefix header so the test target can import GitX headers.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose prune as a command of its own, so a one-off prune no longer means
flipping the global "Prune on fetch" preference back and forth.
Fetch "origin" and Prunein the ref context menus, right afterthe plain fetch item, and add
Fetch and PruneplusFetch All and Pruneto the Repository menu.invocation passes
--prunein every preference state, including"Never prune", since a deliberate action should beat a default.
action rejected remote-branch refs, so an enabled
Fetch "origin"ona remote branch did nothing at all - no fetch, no sheet, no error.
Test plan:
decides without the override, the override wins in all three
preference states, and the flag precedes the remote name.
Fetch,Fetch and Prune,Fetch All,Fetch All and Prune, inthat order, with the new nib connections in place.
Fetch "origin" and Prunewith alive sidebar selection, and an end-to-end prune dropping a stale
remote branch. GitX windows are not reachable by accessibility on
this machine.