File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,16 @@ import {
77 CommitFilesResult ,
88} from "./interface" ;
99
10+ /**
11+ * @see https://isomorphic-git.org/docs/en/walk#walkerentry-mode
12+ */
13+ const FILE_MODES = {
14+ directory : 0o40000 ,
15+ file : 0o100644 ,
16+ executableFile : 0o100755 ,
17+ symlink : 0o120000 ,
18+ } as const ;
19+
1020export const commitChangesFromRepo = async ( {
1121 base,
1222 repoDirectory = process . cwd ( ) ,
@@ -50,6 +60,14 @@ export const commitChangesFromRepo = async ({
5060 ) {
5161 return null ;
5262 }
63+ if (
64+ ( await commit ?. mode ( ) ) === FILE_MODES . symlink ||
65+ ( await workdir ?. mode ( ) ) === FILE_MODES . symlink
66+ ) {
67+ throw new Error (
68+ `Unexpected symlink at ${ filepath } , GitHub API only supports files and directories. You may need to add this file to .gitignore` ,
69+ ) ;
70+ }
5371 const prevOid = await commit ?. oid ( ) ;
5472 const currentOid = await workdir ?. oid ( ) ;
5573 // Don't include files that haven't changed, and exist in both trees
You can’t perform that action at this time.
0 commit comments