Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

Commit

Permalink
ignore checkout null message
Browse files Browse the repository at this point in the history
  • Loading branch information
onlyutkarsh committed Feb 23, 2019
1 parent 3c8a245 commit bf29004
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tasks/.taskkey
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d9eaeb78-a2c1-41bd-ada6-02b358fbf372
44eddf5e-ef3f-4cff-8702-8ebf9a942d58
5 changes: 2 additions & 3 deletions tasks/DownloadRepo/DownloadRepoV1/gitapi.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as axios from "axios";
import * as url from "url";
import { AxiosResponse } from "axios";

export class GitApi {

Expand All @@ -24,7 +23,7 @@ export class GitApi {

branch = branch || "";
let commitId: string;
let response: AxiosResponse<any>;
let response: axios.AxiosResponse<any>;
if (branch.trim() === "") {
// get commits from default branch
response = await this.exec(commitsFromDefaultBranchUrl, token);
Expand All @@ -48,7 +47,7 @@ export class GitApi {
return commitId;
}

private async exec(url: string, token: string): Promise<AxiosResponse<any>> {
private async exec(url: string, token: string): Promise<axios.AxiosResponse<any>> {
let config: axios.AxiosRequestConfig = {
headers: { "Private-Token": token },
method: "get"
Expand Down
8 changes: 7 additions & 1 deletion tasks/DownloadRepo/DownloadRepoV1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ async function main() {
await gitWrapper.clone(formattedRepoUrl, false, downloadPath, options);
console.info("Done");

console.info(`Checking out branch '${branch}'`);
if (versionSelector === "latestDefaultBranch") {
console.info(`Checking out from default branch`);
branch = branch || "";
}
else {
console.info(`Checking out branch '${branch}'`);
}
// Checkout branch
await gitWrapper.checkout(branch, options);
console.info("Done");
Expand Down

0 comments on commit bf29004

Please sign in to comment.