Skip to content

Commit

Permalink
Merge pull request #10 from KyrietS/master
Browse files Browse the repository at this point in the history
Fixed #9 Refusing to fetch into current branch
  • Loading branch information
s0 authored Apr 5, 2020
2 parents 43169ff + f8386e7 commit 1514fb5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion action/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ var writeToProcess = function (command, args, opts) { return new Promise(functio
// Clone the target repo
_e.sent();
// Fetch branch if it exists
return [4 /*yield*/, exec("git fetch origin " + config.branch + ":" + config.branch, { env: env, cwd: REPO_TEMP }).catch(function (err) {
return [4 /*yield*/, exec("git fetch -u origin " + config.branch + ":" + config.branch, { env: env, cwd: REPO_TEMP }).catch(function (err) {
var s = err.toString();
if (s.indexOf('Couldn\'t find remote ref') === -1) {
console.error('##[warning] Failed to fetch target branch, probably doesn\'t exist');
Expand Down
2 changes: 1 addition & 1 deletion action/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ const writeToProcess = (command: string, args: string[], opts: {env: { [id: stri
});

// Fetch branch if it exists
await exec(`git fetch origin ${config.branch}:${config.branch}`, { env, cwd: REPO_TEMP }).catch(err => {
await exec(`git fetch -u origin ${config.branch}:${config.branch}`, { env, cwd: REPO_TEMP }).catch(err => {
const s = err.toString();
if (s.indexOf('Couldn\'t find remote ref') === -1) {
console.error('##[warning] Failed to fetch target branch, probably doesn\'t exist')
Expand Down

0 comments on commit 1514fb5

Please sign in to comment.