Skip to content

Commit 625a03f

Browse files
committed
Fixes trying to visualize untracked files
1 parent 2f46b33 commit 625a03f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/git/gitUri.utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ import { GitUri, isGitUri } from './gitUri';
44

55
export async function ensureWorkingUri(container: Container, uri: Uri | undefined): Promise<Uri | undefined> {
66
if (uri == null) return undefined;
7+
if (!container.git.isTrackable(uri)) return undefined;
78

89
const gitUri = !isGitUri(uri) ? await GitUri.fromUri(uri) : uri;
9-
if (gitUri.sha != null) {
10+
if (gitUri.sha) {
1011
// If we have a sha, normalize the history to the working file (so we get a full history all the time)
1112
const workingUri = await container.git.getWorkingUri(gitUri.repoPath!, gitUri);
1213
if (workingUri != null) {
1314
uri = workingUri;
1415
}
16+
} else if (!(await container.git.isTracked(uri))) {
17+
return undefined;
1518
}
1619

1720
return uri;

0 commit comments

Comments
 (0)