File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import { Svn } from "./svn";
24
24
import {
25
25
fixPathSeparator ,
26
26
fixPegRevision ,
27
+ isDescendant ,
27
28
normalizePath ,
28
29
unwrap
29
30
} from "./util" ;
@@ -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