diff --git a/package.json b/package.json index 21b6a0f..4c76a2b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "patchport", - "version": "1.0.0", + "version": "1.0.1", "description": "a deployment and development environment management utility", "main": "index.js", "bin": { diff --git a/src/index.ts b/src/index.ts index 663821c..c655ab0 100755 --- a/src/index.ts +++ b/src/index.ts @@ -47,7 +47,7 @@ async function run() { } // No commit ID provided, display git log for selection - commitId = await GitHelpers.selectCommitFromLog() + commitId = await GitHelpers.selectCommitFromLog(originBranch) if (!commitId) { console.error('No commit selected. Exiting.') process.exit(1) diff --git a/src/utils/gitHelpers.ts b/src/utils/gitHelpers.ts index cea88f1..7252e9a 100644 --- a/src/utils/gitHelpers.ts +++ b/src/utils/gitHelpers.ts @@ -54,11 +54,14 @@ async function promptForOriginBranch(): Promise { return originBranch } -export async function selectCommitFromLog(): Promise { +export async function selectCommitFromLog( + branchName: string +): Promise { console.log('') const git: SimpleGit = simpleGit() try { // Fetch the latest commits from the current branch + await git.pull('origin', branchName) const log = await git.log({ maxCount: 20 }) if (log.all.length === 0) {