We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 17418a8 commit 0a2d5beCopy full SHA for 0a2d5be
packages/workspace/src/core/file-utils.ts
@@ -89,9 +89,17 @@ function defaultReadFileAtRevision(
89
revision: void | string
90
): string {
91
try {
92
+ const fileFullPath = `${appRootPath}${path.sep}${file}`;
93
+ const gitRepositoryPath = execSync('git rev-parse --show-toplevel')
94
+ .toString()
95
+ .trim();
96
+ const filePathInGitRepository = path
97
+ .relative(gitRepositoryPath, fileFullPath)
98
+ .split(path.sep)
99
+ .join('/');
100
return !revision
101
? readFileSync(file).toString()
- : execSync(`git show ${revision}:${file}`, {
102
+ : execSync(`git show ${revision}:${filePathInGitRepository}`, {
103
maxBuffer: TEN_MEGABYTES
104
})
105
.toString()
0 commit comments