Skip to content

Commit dacb516

Browse files
committed
fix: allow legitimate empty diffs in scanDiff to support force pushes
1 parent 94d807d commit dacb516

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/proxy/processors/push-action/scanDiff.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ type Match = {
3535
const getDiffViolations = (diff: string, organization: string): Match[] | string | null => {
3636
// Commit diff is empty, i.e. '', null or undefined
3737
if (!diff) {
38-
console.log('No commit diff...');
39-
return 'No commit diff...';
38+
console.log('No commit diff found, but this may be legitimate (empty diff)');
39+
// Empty diff is not necessarily a violation - could be legitimate
40+
// (e.g., cherry-pick with no changes, reverts, etc.)
41+
return null;
4042
}
4143

4244
// Validation for configured block pattern(s) check...

0 commit comments

Comments
 (0)