{#if gitStatus?.is_repo}
{#if expanded}
{/if}
{ expanded = !expanded; if (expanded) { refresh(); if (view === 'history') loadHistory(); } }} > {#if gitStatus.ahead > 0}↑{gitStatus.ahead}{/if} {#if gitStatus.behind > 0}↓{gitStatus.behind}{/if} {#if totalChanges > 0}{$t('git.changedCount', { count: totalChanges })}{/if} {#if actionMsg}{actionMsg}{/if}
{#if showBranches}
(showBranches = false)}>
{#if creatingBranch}
{ if (e.key === 'Enter') createBranch(); if (e.key === 'Escape') { creatingBranch = false; newBranchName = ''; } }} autofocus />
{:else} {/if} {#if branchData} {#each branchData.all ?? [] as b} {/each} {:else}
{/if}
{/if} {#if expanded}
{#if showDiff} {/if}
{#if remoteWebUrl} {/if}
{#if view === 'changes'} {#if totalChanges > 0} {/if}
{#each gitStatus?.files ?? [] as file (`${file.path}:${file.staged}`)} {@const fp = fPath(file.path)} {@const sc = statusChar(file.status)} {/each}
{ if (e.key === 'Enter' && !e.shiftKey) doCommit(); }} />
{:else}
{#each commits as c, i} {#if i === unpushedCount && unpushedCount > 0}
{unpushedCount} unpushed {unpushedCount === 1 ? 'commit' : 'commits'}
{/if} {/each} {#if !commits.length}
{$t('git.noCommits')}
{/if}
{/if}
{#if fileDiff.length}
{#each fileDiff as df} {#if fileDiff.length > 1}
{df.path}
{/if} {#each df.hunks as hunk}
{hunk.header}
{#each groupLines(hunk.lines) as group}
{#each group.lines as line}
{line.type === 'added' ? '+' : line.type === 'removed' ? '-' : ' '}{line.content}
{/each}
{/each} {/each} {/each}
{:else}
{#if view === 'history' && !selectedCommit} {$t('git.selectCommit')} {:else if totalChanges} {$t('git.selectFile')} {:else} {$t('git.noLocalChanges')} {/if}
{/if}
{/if}
{/if} {#if contextMenu} discardFile(contextMenu!.file.path) }, { label: $t('git.copyFilePath'), icon: 'copy', onclick: () => copyFilePath(contextMenu!.file.path) }, { label: $t('git.copyRelativePath'), icon: 'copy', onclick: () => copyRelativePath(contextMenu!.file.path) } ]} onclose={closeContextMenu} /> {/if} {#if commitMenu} { doUncommit(); closeCommitMenu(); } } ] : []), { label: $t('git.copyCommitHash'), icon: 'copy', onclick: () => { navigator.clipboard.writeText(commitMenu!.commit.hash); flash($t('git.copiedPath')); closeCommitMenu(); } } ]} onclose={closeCommitMenu} /> {/if}