feat: change worktree presentation (#978)

Present the worktree name first, then relative path to the main repo.

This is more aligned with Git's own UI,  and works better with UI size constrains.
This commit is contained in:
Dmitrij D. Czarkoff 2025-02-13 02:41:08 +00:00 committed by GitHub
parent c6aedf1193
commit 588879eb7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 8 deletions

View file

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
namespace SourceGit.Commands
{
@ -26,6 +27,7 @@ namespace SourceGit.Commands
if (line.StartsWith("worktree ", StringComparison.Ordinal))
{
last = new Models.Worktree() { FullPath = line.Substring(9).Trim() };
last.RelativePath = Path.GetRelativePath(WorkingDirectory, last.FullPath);
worktrees.Add(last);
}
else if (line.StartsWith("bare", StringComparison.Ordinal))