(node: NodeNameParts, words: BranchNameWords = galaxyNodeNameText)
| 49 | |
| 50 | /** The shown name: "django-demo · detached HEAD" for a Branch node, the node's own name for every other. */ |
| 51 | export function nodeDisplayName(node: NodeNameParts, words: BranchNameWords = galaxyNodeNameText): string { |
| 52 | const branch = branchNodeOf(node); |
| 53 | if (!branch) return node.name; |
| 54 | const what = branch.state === 'detached' ? words.detached : branch.state === 'working-tree' ? words.workingTree : words.branch(branch.name); |
| 55 | return branch.project ? words.inProject(branch.project, what) : what; |
| 56 | } |
| 57 | |
| 58 | const partsOf = (node: GraphNode): NodeNameParts => ({ name: node.name, label: node.label, qualifiedName: node.qualified_name }); |
| 59 |
no test coverage detected