mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-11-13 15:57:14 +01:00
handle invalid commit sha
This commit is contained in:
1 parent
a4c722bf77
commit
7c88392aba
1 file changed
+5
-1
+5
-1
@@ -120,7 +120,11 @@ module.exports.getTree = async (repoConfig, sha, truncatedTree, parentPath) => {
|
||||
const repo = gh(repoConfig.fullName);
|
||||
|
||||
if (!sha) {
|
||||
sha = repoConfig.commit ? repoConfig.commit : "HEAD";
|
||||
if (repoConfig.commit && !/^[a-f0-9]+$/.test(repoConfig.commit)) {
|
||||
sha = repoConfig.commit
|
||||
} else {
|
||||
sha = "HEAD"
|
||||
}
|
||||
}
|
||||
if (!parentPath) parentPath = "";
|
||||
|
||||
|
||||
Reference in new issue
Block a user