mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
sync worktree view with web
This commit is contained in:
parent
bf76d779ea
commit
5b18b6712c
1 changed files with 6 additions and 8 deletions
|
|
@ -255,16 +255,14 @@ struct GitBranchWorktreeSelector: View {
|
||||||
|
|
||||||
private func formatWorktreeName(_ worktree: Worktree) -> String {
|
private func formatWorktreeName(_ worktree: Worktree) -> String {
|
||||||
let folderName = URL(fileURLWithPath: worktree.path).lastPathComponent
|
let folderName = URL(fileURLWithPath: worktree.path).lastPathComponent
|
||||||
let showBranch = folderName.lowercased() != worktree.branch.lowercased() &&
|
// Strip refs/heads/ prefix from branch name for comparison and display
|
||||||
!folderName.lowercased().hasSuffix("-\(worktree.branch.lowercased())")
|
let branchName = worktree.branch.replacingOccurrences(of: "refs/heads/", with: "")
|
||||||
|
let showBranch = folderName.lowercased() != branchName.lowercased() &&
|
||||||
|
!folderName.lowercased().hasSuffix("-\(branchName.lowercased())")
|
||||||
|
|
||||||
var result = ""
|
var result = folderName
|
||||||
if worktree.branch == selectedWorktree {
|
|
||||||
result += "Use selected worktree: "
|
|
||||||
}
|
|
||||||
result += folderName
|
|
||||||
if showBranch {
|
if showBranch {
|
||||||
result += " [\(worktree.branch)]"
|
result += " [\(branchName)]"
|
||||||
}
|
}
|
||||||
if worktree.isMainWorktree == true {
|
if worktree.isMainWorktree == true {
|
||||||
result += " (main)"
|
result += " (main)"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue