We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b4339f commit 2d2f962Copy full SHA for 2d2f962
src/components/diff/DiffWidget.tsx
@@ -80,17 +80,16 @@ export async function getRelativeFilePath(
80
path: string,
81
topRepoPath: string
82
): Promise<string> {
83
- if (serverRootResultCache !== null) {
84
- return serverRootResultCache;
85
- } else {
+ if (serverRootResultCache === null) {
86
const response = await httpGitRequest('/git/server_root', 'GET', null);
87
const responseData = await response.json();
88
- serverRootResultCache = PathExt.join(
89
- PathExt.relative(responseData['server_root'], topRepoPath),
90
- path
91
- );
92
+ serverRootResultCache = responseData['server_root'];
93
}
+
+ return PathExt.join(
+ PathExt.relative(serverRootResultCache, topRepoPath),
+ path
+ );
94
95
96
/**
0 commit comments