File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -13,17 +13,18 @@ const cacheWorktree = new Cache<string, string | Error>(ttl);
13
13
* @returns A root path of a git working directory.
14
14
*/
15
15
export async function findWorktree ( cwd : string ) : Promise < string > {
16
- const result = cacheWorktree . get ( cwd ) ?? await ( async ( ) => {
16
+ const path = await Deno . realPath ( cwd ) ;
17
+ const result = cacheWorktree . get ( path ) ?? await ( async ( ) => {
17
18
let result : string | Error ;
18
19
try {
19
- result = await revParse ( cwd , [
20
+ result = await revParse ( path , [
20
21
"--show-toplevel" ,
21
22
"--show-superproject-working-tree" ,
22
23
] ) ;
23
24
} catch ( e ) {
24
25
result = e ;
25
26
}
26
- cacheWorktree . set ( cwd , result ) ;
27
+ cacheWorktree . set ( path , result ) ;
27
28
return result ;
28
29
} ) ( ) ;
29
30
if ( result instanceof Error ) {
You can’t perform that action at this time.
0 commit comments