Merge branch 'main' into codeql_download_info

This commit is contained in:
Robert 2020-09-07 13:37:20 +01:00 committed by GitHub
commit 1a772a2b9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 5 deletions

View file

@ -66,6 +66,16 @@ function importTracerEnvironment(config: Config) {
}
}
// Allow the user to specify refs in full refs/heads/branch format
// or just the short branch name and prepend "refs/heads/" to it.
function parseRef(userInput: string): string {
if (userInput.startsWith('refs/')) {
return userInput;
} else {
return 'refs/heads/' + userInput;
}
}
interface InitArgs {
languages: string | undefined;
queries: string | undefined;
@ -265,7 +275,7 @@ program
await runAnalyze(
parseRepositoryNwo(cmd.repository),
cmd.commit,
cmd.ref,
parseRef(cmd.ref),
undefined,
undefined,
undefined,
@ -316,7 +326,7 @@ program
cmd.sarifFile,
parseRepositoryNwo(cmd.repository),
cmd.commit,
cmd.ref,
parseRef(cmd.ref),
undefined,
undefined,
undefined,