Skip to content

Commit

Permalink
fix(import): Better handling of "Patch is empty" (#2588)
Browse files Browse the repository at this point in the history
Using `git diff COMMIT^!` to check if patch is empty instead of English-only hard-coded string.
  • Loading branch information
TimShilov committed Nov 8, 2020
1 parent f6e7a13 commit 0497bc7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion commands/import/index.js
Expand Up @@ -237,7 +237,9 @@ class ImportCommand extends Command {
tracker.completeWork(1);
})
.catch(err => {
if (err.stdout.indexOf("Patch is empty.") === 0) {
// Getting commit diff to see if it's empty
const diff = this.externalExecSync("git", ["diff", "-s", `${sha}^!`]).trim();
if (diff === "") {
tracker.completeWork(1);

// Automatically skip empty commits
Expand Down

0 comments on commit 0497bc7

Please sign in to comment.