Skip to content

Commit a95fef7

Browse files
committed
fix: Fixed "failed to open path" for remote (close #593)
1 parent 3b5e2bb commit a95fef7

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/svnRepository.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ import {
2525
fixPathSeparator,
2626
fixPegRevision,
2727
normalizePath,
28-
unwrap
28+
unwrap,
29+
isDescendant
2930
} from "./util";
3031

3132
export class Repository {
@@ -183,10 +184,17 @@ export class Repository {
183184
filePath = file;
184185
}
185186

186-
let target: string = this.removeAbsolutePath(filePath);
187+
const isChild = uri.scheme === "file" && isDescendant(this.workspaceRoot, uri.fsPath);
188+
189+
let target: string = filePath;
190+
191+
if (isChild) {
192+
target = this.removeAbsolutePath(target);
193+
}
194+
187195
if (revision) {
188196
args.push("-r", revision);
189-
if (!["BASE", "COMMITTED", "PREV"].includes(revision.toUpperCase())) {
197+
if (isChild && !["BASE", "COMMITTED", "PREV"].includes(revision.toUpperCase())) {
190198
const info = await this.getInfo();
191199
target = info.url + "/" + target.replace(/\\/g, "/");
192200
// TODO move to SvnRI

0 commit comments

Comments
 (0)