Skip to content

Commit

Permalink
spawn git clone
Browse files Browse the repository at this point in the history
to prevent injecting a command
  • Loading branch information
Kelly Selden committed Jan 6, 2020
1 parent bfcc903 commit 106d61d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const resolveConflicts = require('./resolve-conflicts');
const commitAndTag = require('./commit-and-tag');
const gitRemoveAll = require('./git-remove-all');
const createCustomRemote = require('./create-custom-remote');
const { runWithSpawn } = require('./run');

const { isGitClean } = gitStatus;
const { gitConfigInit } = gitInit;
Expand Down Expand Up @@ -222,7 +223,7 @@ module.exports = async function gitDiffApply({
_tmpDir = await tmpDir();
tmpWorkingDir = _tmpDir;

await utils.run(`git clone ${remoteUrl} ${_tmpDir}`);
await runWithSpawn('git', ['clone', remoteUrl, _tmpDir]);

// needed because we are going to be committing in here
await gitConfigInit({ cwd: _tmpDir });
Expand Down

0 comments on commit 106d61d

Please sign in to comment.