Skip to content

Commit 60ee143

Browse files
committed
Flips logic to avoid extra checks
1 parent 8a182e9 commit 60ee143

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/git/gitUri.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class GitUri extends (Uri as any as UriEx) {
7979
ref = commitOrRepoPath.sha;
8080
}
8181

82-
if (isUncommittedStaged(ref) || !isUncommitted(ref)) {
82+
if (!isUncommitted(ref) || isUncommittedStaged(ref)) {
8383
this.sha = ref;
8484
}
8585

@@ -99,7 +99,7 @@ export class GitUri extends (Uri as any as UriEx) {
9999
ref = commitOrRepoPath.sha;
100100
}
101101

102-
if (ref && (isUncommittedStaged(ref) || !isUncommitted(ref))) {
102+
if (ref && (!isUncommitted(ref) || isUncommittedStaged(ref))) {
103103
this.sha = ref;
104104
}
105105

@@ -164,7 +164,7 @@ export class GitUri extends (Uri as any as UriEx) {
164164
fragment: uri.fragment,
165165
});
166166
this.repoPath = commitOrRepoPath.repoPath;
167-
if (isUncommittedStaged(commitOrRepoPath.sha) || !isUncommitted(commitOrRepoPath.sha)) {
167+
if (!isUncommitted(commitOrRepoPath.sha) || isUncommittedStaged(commitOrRepoPath.sha)) {
168168
this.sha = commitOrRepoPath.sha;
169169
}
170170
}

0 commit comments

Comments
 (0)