git-diff-apply
Advanced tools
Comparing version 0.20.5 to 0.20.6
{ | ||
"name": "git-diff-apply", | ||
"version": "0.20.5", | ||
"version": "0.20.6", | ||
"description": "Use an unrelated remote repository to apply a git diff", | ||
@@ -5,0 +5,0 @@ "main": "src", |
@@ -141,9 +141,6 @@ 'use strict'; | ||
async function applyDiff() { | ||
let patchFile = await createPatchFile(); | ||
if (patchFile) { | ||
// --whitespace=fix seems to prevent any unnecessary conflicts with line endings | ||
// https://stackoverflow.com/questions/6308625/how-to-avoid-git-apply-changing-line-endings#comment54419617_11189296 | ||
await utils.run(`git apply --whitespace=fix ${patchFile}`); | ||
} | ||
async function applyPatch(patchFile) { | ||
// --whitespace=fix seems to prevent any unnecessary conflicts with line endings | ||
// https://stackoverflow.com/questions/6308625/how-to-avoid-git-apply-changing-line-endings#comment54419617_11189296 | ||
await utils.run(`git apply --whitespace=fix ${patchFile}`); | ||
} | ||
@@ -189,5 +186,10 @@ | ||
let patchFile = await createPatchFile(); | ||
if (!patchFile) { | ||
return; | ||
} | ||
isCodeUntracked = true; | ||
isCodeModified = true; | ||
await applyDiff(); | ||
await applyPatch(patchFile); | ||
@@ -281,6 +283,2 @@ await resetIgnoredFiles(); | ||
} | ||
if (isTempBranchCheckedOut) { | ||
await utils.run(`git checkout ${oldBranchName}`); | ||
} | ||
} catch (err2) { | ||
@@ -295,2 +293,6 @@ throw { | ||
try { | ||
if (isTempBranchCheckedOut) { | ||
await utils.run(`git checkout ${oldBranchName}`); | ||
} | ||
if (isTempBranchCommitted && await doesBranchExist(tempBranchName)) { | ||
@@ -297,0 +299,0 @@ await utils.run(`git branch -D ${tempBranchName}`); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21072
599