Skip to content

Commit e5f07e1

Browse files
committed
Merge pull request #47 from neel1996/compare-feature
1 parent 0202d1b commit e5f07e1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

git/gitCommitCompareApi.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,15 @@ async function gitCommitCompare(repoPath, baseCommit, compareCommit) {
4949
};
5050
});
5151

52-
console.log(diffFileItems);
53-
54-
return diffFileItems;
52+
if (diffFileItems && diffFileItems.length > 0) {
53+
console.log(diffFileItems);
54+
return diffFileItems;
55+
} else {
56+
return {
57+
message:
58+
"warning: There are no file changes in the base commit. Make sure that it is not a PR merge commit!",
59+
};
60+
}
5561
}
5662

5763
module.exports.gitCommitCompare = gitCommitCompare;

0 commit comments

Comments
 (0)