File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ import {
25
25
fixPathSeparator ,
26
26
fixPegRevision ,
27
27
normalizePath ,
28
- unwrap
28
+ unwrap ,
29
+ isDescendant
29
30
} from "./util" ;
30
31
31
32
export class Repository {
@@ -183,10 +184,17 @@ export class Repository {
183
184
filePath = file ;
184
185
}
185
186
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
+
187
195
if ( revision ) {
188
196
args . push ( "-r" , revision ) ;
189
- if ( ! [ "BASE" , "COMMITTED" , "PREV" ] . includes ( revision . toUpperCase ( ) ) ) {
197
+ if ( isChild && ! [ "BASE" , "COMMITTED" , "PREV" ] . includes ( revision . toUpperCase ( ) ) ) {
190
198
const info = await this . getInfo ( ) ;
191
199
target = info . url + "/" + target . replace ( / \\ / g, "/" ) ;
192
200
// TODO move to SvnRI
You can’t perform that action at this time.
0 commit comments