Skip to content

Commit 24dc9dc

Browse files
committed
fix git diff commands
1 parent 3b8e314 commit 24dc9dc

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

.github/workflows/bin/refresh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ if ($return !== 0) {
6565
/**
6666
* Check if something changed
6767
*/
68-
$output = call('git diff --numstat src/');
68+
$output = call('git diff --numstat -- src/');
6969

7070
if (empty($output)) {
7171
console_log('Nothing changed.');
@@ -98,7 +98,7 @@ foreach ($output as $line) {
9898
continue;
9999
}
100100

101-
$fileChanges = call('git diff --no-color -U0 '.escapeshellarg($file));
101+
$fileChanges = call('git diff --no-color -U0 -- '.escapeshellarg($file));
102102
foreach ($fileChanges as $lineChange) {
103103
if (!$lineChange) {
104104
continue;

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
echo "###################################################"
9898
echo ""
9999
100-
git diff src
100+
git diff -- src
101101
102102
exit 1
103103
fi

tests/Unit/ChangelogTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ static function ($branch) {
198198
});
199199

200200
$output = array_merge(
201-
self::call('git diff --numstat HEAD src/'),
202-
self::call('git diff --numstat ' . $branches[0] . '...HEAD src/')
201+
self::call('git diff --numstat HEAD -- src/'),
202+
self::call('git diff --numstat ' . $branches[0] . '...HEAD -- src/')
203203
);
204204

205205
$changedServices = [];
@@ -250,7 +250,7 @@ static function ($branch) {
250250

251251
$isCommentOnly = true;
252252
foreach ($changedFiles as $changedFile) {
253-
$changedLines = self::call('git diff --no-color -U0 ' . escapeshellarg($changesService['base'] . $changedFile));
253+
$changedLines = self::call('git diff --no-color -U0 -- ' . escapeshellarg($changesService['base'] . $changedFile));
254254
foreach ($changedLines as $changedLine) {
255255
if (!$changedLine) {
256256
continue;

0 commit comments

Comments
 (0)