Skip to content

Commit 486d1bd

Browse files
committed
Do not show lock text in file diff view
We don't have local commits in the context at the stack level.
1 parent f6ea6b0 commit 486d1bd

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

apps/desktop/src/components/FileDiff.svelte

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import HunkViewer from '$components/HunkViewer.svelte';
33
import InfoMessage from '$components/InfoMessage.svelte';
44
import LargeDiffMessage from '$components/LargeDiffMessage.svelte';
5-
import { getLocalCommits, getLocalAndRemoteCommits } from '$lib/commits/contexts';
65
import { FileService } from '$lib/files/fileService';
76
import { getLockText } from '$lib/files/lock';
87
import { Project } from '$lib/project/project';
@@ -38,10 +37,6 @@
3837
let alwaysShow = $state(false);
3938
const project = getContext(Project);
4039
const fileService = getContext(FileService);
41-
const localCommits = isFileLocked ? getLocalCommits() : undefined;
42-
const remoteCommits = isFileLocked ? getLocalAndRemoteCommits() : undefined;
43-
44-
const commits = isFileLocked ? ($localCommits || []).concat($remoteCommits || []) : undefined;
4540
4641
function getGutterMinWidth(max: number | undefined) {
4742
if (!max) {
@@ -124,14 +119,14 @@
124119
{#each sections as section}
125120
{@const { added, removed } = computeAddedRemovedByHunk(section)}
126121
{#if 'hunk' in section}
127-
{@const isHunkLocked = section.hunk.lockedTo && section.hunk.lockedTo.length > 0 && commits}
122+
{@const isHunkLocked = section.hunk.lockedTo && section.hunk.lockedTo.length > 0}
128123
<div class="hunk-wrapper">
129124
{#if isHunkLocked || section.hunk.poisoned}
130125
<div class="indicators text-11 text-semibold">
131126
{#if isHunkLocked}
132127
<InfoMessage filled outlined={false} style="warning" icon="locked">
133128
{#snippet content()}
134-
{getLockText(section.hunk.lockedTo, commits)}
129+
{getLockText(section.hunk.lockedTo, [])}
135130
{/snippet}
136131
</InfoMessage>
137132
{/if}

0 commit comments

Comments
 (0)