Skip to content

Commit 1514fb5

Browse files
authored
Merge pull request #10 from KyrietS/master
Fixed #9 Refusing to fetch into current branch
2 parents 43169ff + f8386e7 commit 1514fb5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

action/dist/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ var writeToProcess = function (command, args, opts) { return new Promise(functio
772772
// Clone the target repo
773773
_e.sent();
774774
// Fetch branch if it exists
775-
return [4 /*yield*/, exec("git fetch origin " + config.branch + ":" + config.branch, { env: env, cwd: REPO_TEMP }).catch(function (err) {
775+
return [4 /*yield*/, exec("git fetch -u origin " + config.branch + ":" + config.branch, { env: env, cwd: REPO_TEMP }).catch(function (err) {
776776
var s = err.toString();
777777
if (s.indexOf('Couldn\'t find remote ref') === -1) {
778778
console.error('##[warning] Failed to fetch target branch, probably doesn\'t exist');

action/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ const writeToProcess = (command: string, args: string[], opts: {env: { [id: stri
258258
});
259259

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

0 commit comments

Comments
 (0)