1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 06:42:41 +01:00

Merge pull request #5 from mareksapota-fb/master

Pull request for differential revision D1022
This commit is contained in:
Evan Priestley 2011-10-19 17:32:33 -07:00
commit 34451ceaaf
3 changed files with 14 additions and 1 deletions

View file

@ -204,7 +204,7 @@ class ArcanistDiffParser {
// This is a git commit message, probably from "git show". // This is a git commit message, probably from "git show".
'(?P<type>commit) (?P<hash>[a-f0-9]+)', '(?P<type>commit) (?P<hash>[a-f0-9]+)',
// This is a git diff, probably from "git show" or "git diff". // This is a git diff, probably from "git show" or "git diff".
'(?P<type>diff --git) a/(?P<old>.+) b/(?P<cur>.+)', '(?P<type>diff --git) [abicwo12]/(?P<old>.+) [abicwo12]/(?P<cur>.+)',
// This is a unified diff, probably from "diff -u" or synthetic diffing. // This is a unified diff, probably from "diff -u" or synthetic diffing.
'(?P<type>---) (?P<old>.+)\s+\d{4}-\d{2}-\d{2}.*', '(?P<type>---) (?P<old>.+)\s+\d{4}-\d{2}-\d{2}.*',
'(?P<binary>Binary) files '. '(?P<binary>Binary) files '.

View file

@ -418,6 +418,12 @@ EOTEXT
$this->assertEqual(0, count($change->getHunks())); $this->assertEqual(0, count($change->getHunks()));
} }
break; break;
case 'git-mnemonicprefix.gitdiff':
// Check parsing of diffs created with `diff.mnemonicprefix`
// configuration option set to `true`.
$this->assertEqual(1, count($changes));
$this->assertEqual(1, count(reset($changes)->getHunks()));
break;
case 'git-commit.gitdiff': case 'git-commit.gitdiff':
$this->assertEqual(1, count($changes)); $this->assertEqual(1, count($changes));
$change = reset($changes); $change = reset($changes);

View file

@ -0,0 +1,7 @@
diff --git i/FILE w/FILE
index e8b5482..2a42638 100644
--- i/FILE
+++ w/FILE
@@ -1 +1,2 @@
TEXT
+MORE TEXT