Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two problems with local git diffs #291

Merged
merged 24 commits into from
Sep 15, 2022
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a13fab8
Fix a problem with spaces in file names; adds two new functions.
gudmdharalds Aug 10, 2022
2f06009
Add test for vipgoci_gitrepo_diffs_clean_extra_whitespace()
gudmdharalds Aug 10, 2022
63fa810
Breaking function up into two parts.
gudmdharalds Aug 10, 2022
4f5142d
Add test for vipgoci_gitrepo_get_file_path_from_diff()
gudmdharalds Aug 10, 2022
61c04d7
WP CS updates
gudmdharalds Aug 10, 2022
012c45d
Merge branch 'trunk' into fix/space-in-filenames
gudmdharalds Aug 10, 2022
0ad1e04
Determine status of files renamed and modified differently.
gudmdharalds Aug 10, 2022
1ca2f2f
Merge branch 'fix/space-in-filenames' of github.com:Automattic/vip-go…
gudmdharalds Aug 10, 2022
fcce399
Update comment.
gudmdharalds Aug 11, 2022
855160a
Update commit ID.
gudmdharalds Aug 11, 2022
e5c8b0d
New files added.
gudmdharalds Aug 11, 2022
e38475b
Fix WP CS issue.
gudmdharalds Aug 11, 2022
0a9efb2
Suppress/unsuppress output
gudmdharalds Aug 11, 2022
4cbcc2c
Updated comment.
gudmdharalds Aug 11, 2022
927aa0f
Override file-status as modified in certain cases.
gudmdharalds Aug 11, 2022
780053d
Handle special case while matching results.
gudmdharalds Sep 6, 2022
560311a
WP CS changes.
gudmdharalds Sep 6, 2022
b09591b
Update unit-test; test special case, apply WP CS changes.
gudmdharalds Sep 6, 2022
2affe59
Clarify comment.
gudmdharalds Sep 6, 2022
e296756
Remove json_decode() usage.
gudmdharalds Sep 6, 2022
7a22cb2
Merge pull request #293 from Automattic/fix/repeated-comments
gudmdharalds Sep 15, 2022
352ecc6
Merge branch 'trunk' into fix/space-in-filenames
gudmdharalds Sep 15, 2022
e15d43b
Update github-api.php
gudmdharalds Sep 15, 2022
c08f329
Update GitDiffsFetchUnfilteredTrait.php
gudmdharalds Sep 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
New files added.
gudmdharalds committed Aug 11, 2022
commit e5c8b0d96ad06506bc61e26c8f50567bfe0ff304
37 changes: 35 additions & 2 deletions tests/integration/GitDiffsFetchUnfilteredTrait.php
Original file line number Diff line number Diff line change
@@ -145,6 +145,19 @@ private function _dataGitDiffsAssert5() {
private function _dataGitDiffsAssert6() {
return array(
'files' => array(
/* File renamed, content added */
'README file.md' => array(
'filename' => 'README file.md',
'patch' => "@@ -1,2 +1,5 @@\n" .
' # vip-go-ci-testing' . PHP_EOL .
' Pull-Requests, commits and data to test <a href="https://github.com/automattic/vip-go-ci/">vip-go-ci</a>\'s functionality. Please do not remove or alter unless you\'ve contacted the VIP Team first. ' . PHP_EOL . '+' . PHP_EOL . '+' . PHP_EOL . '+',
'status' => 'modified',
'additions' => 3,
'deletions' => 0,
'changes' => 3,
'previous_filename' => 'README.md',
),

'a/new-file.txt' => array(
/* File added, starting with name 'a/' */
'filename' => 'a/new-file.txt',
@@ -155,6 +168,16 @@ private function _dataGitDiffsAssert6() {
'changes' => 2,
),

'b/new file 2.txt' => array(
/* File added, starting with name 'b/', with spaces in file name */
'filename' => 'b/new file 2.txt',
'patch' => '@@ -0,0 +1 @@' . PHP_EOL . '+This is a new file.',
'status' => 'added',
'additions' => 1,
'deletions' => 0,
'changes' => 1,
),

'b/new-file.txt' => array(
/* File added, starting with name 'b/' */
'filename' => 'b/new-file.txt',
@@ -165,6 +188,16 @@ private function _dataGitDiffsAssert6() {
'changes' => 3,
),

'new file 2.txt' => array(
/* File added, starting with name 'b/', with spaces in file name */
'filename' => 'new file 2.txt',
'patch' => '@@ -0,0 +1 @@' . PHP_EOL . '+This is a new test file.',
'status' => 'added',
'additions' => 1,
'deletions' => 0,
'changes' => 1,
),

'new-file-permissions-changed.txt' => array(
/* New file, with permissions changed */
'filename' => 'new-file-permissions-changed.txt',
@@ -238,9 +271,9 @@ private function _dataGitDiffsAssert6() {
),

'statistics' => array(
'additions' => 15,
'additions' => 20,
'deletions' => 6,
'changes' => 21,
'changes' => 26,
)
);
}