You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4a6ba33
Browse filesBrowse the repository at this point in the historyBrowse files
[Worktree] Offer to repair worktree links after the main repository moves
Moving the main repository's folder leaves every linked worktree
pointing at the old place, while `git worktree list` still reports
them as healthy (#739).
- Check each linked worktree's .git link on every worktree reload, the
way `git worktree repair` does, including a worktree nested in the
main folder that moved along with it
- Offer a sheet once per window: Repair as Absolute Paths, Repair as
Relative Paths (git 2.48), or Skip Repair; the default follows the
style the links already share, absolute when they differ
- After Skip, dim the broken rows, offer Repair Worktree Links in the
row menu, and hold Prune back while a moved-along worktree would be
forgotten
return [selfmenuItemWithTitle:NSLocalizedString(@"Locate Worktree Folder…", @"Contextual Menu Item to tell git where a worktree's folder was moved to") action:@selector(locateWorktreeFolder:) worktree:worktree disabledBecause:reason];
return [selfmenuItemWithTitle:NSLocalizedString(@"Repair Worktree Links…", @"Contextual Menu Item to reconnect worktrees that can no longer find the moved main repository") action:@selector(repairWorktreeLinks:) worktree:worktree disabledBecause:reason];
pruneReason = NSLocalizedString(@"Repair the worktree links first: git would forget a worktree that moved with this repository", @"Contextual Menu Item tooltip when pruning would drop a worktree that moved along with the main repository");
1264
1287
elseif (![selfanyWorktreeCanBePruned])
1265
1288
pruneReason = NSLocalizedString(@"Every worktree still has its folder", @"Contextual Menu Item tooltip when no worktree can be pruned");
alert.messageText = worktrees.count == 1 ? NSLocalizedString(@"This repository was moved, so one of its worktrees can no longer find it", @"Title of the sheet when one worktree's link to the moved main repository is broken") : [NSStringstringWithFormat:NSLocalizedString(@"This repository was moved, so %lu of its worktrees can no longer find it", @"Title of the sheet when several worktrees' links to the moved main repository are broken"), (unsignedlong)worktrees.count];
923
+
924
+
NSString *explanation = nil;
925
+
if (!canRepair)
926
+
explanation = [NSStringstringWithFormat:NSLocalizedString(@"Reconnecting them needs git %@ or later, and GitX found git %@. Install a newer git, or choose one in Git Preferences…, then open this repository again.", @"Explanation on the broken worktree links sheet when git cannot repair them"), @PBGitWorktreeRepairVersion, version ?: @"?"];
927
+
elseif (!canChooseStyle)
928
+
explanation = [NSStringstringWithFormat:NSLocalizedString(@"GitX can reconnect them with “git worktree repair”, which writes the link of every worktree of this repository as an absolute path. Relative paths need git %@ or later, and GitX found git %@.", @"Explanation on the broken worktree links sheet when git can repair them only as absolute paths"), @PBGitWorktreeLinkStyleVersion, version];
929
+
else
930
+
explanation = NSLocalizedString(@"GitX can reconnect them with “git worktree repair”, which writes the link of every worktree of this repository in the style you choose.", @"Explanation on the broken worktree links sheet");
0 commit comments