Skip to content

Commit 8ea635c

Browse files
committed
test: getFileFromBranch checks out to branch first, not using FETCH_HEAD
1 parent b0cdc96 commit 8ea635c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/get-file-from-branch.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export function getFileFromBranch(
99
const offset = offsetFromHead ? `~${offsetFromHead}` : ''
1010

1111
execSync(`git fetch origin ${branch}`)
12-
execSync(`git checkout FETCH_HEAD${offset} -- ${filePath}`)
12+
execSync(`git checkout ${branch} -- ${filePath}`)
13+
execSync(`git checkout HEAD${offset} -- ${filePath}`)
1314
return readFileSync(filePath)
1415
}

0 commit comments

Comments
 (0)