Skip to content

Commit c9190aa

Browse files
edgardmessiasJohnstonCode
authored andcommitted
fix: Fixed "failed to open path" for remote (close #593) (#600)
1 parent 3b5e2bb commit c9190aa

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/svnRepository.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { Svn } from "./svn";
2424
import {
2525
fixPathSeparator,
2626
fixPegRevision,
27+
isDescendant,
2728
normalizePath,
2829
unwrap
2930
} from "./util";
@@ -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)