Indefero

Indefero Commit Details


Date:2011-02-25 04:10:10 (13 years 9 months ago)
Author:William MARTIN
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, release-1.1, release-1.2, release-1.3
Commit:cc89a7e6f853005208cc54c78acbe48bde79fa43
Parents: c486fe98fb7a0f38829142b65f46acbe608a874a
Message:Add support of renamed file for IDF_Scm_Git::getchanges()

Changes:

File differences

src/IDF/Scm/Git.php
5656
5757
5858
59
59
6060
6161
6262
......
7575
7676
7777
78
7978
8079
80
8181
8282
83
8384
8485
86
8587
8688
87
89
90
8891
8992
9093
91
94
9295
9396
9497
*/
public function getChanges($commit)
{
$cmd = sprintf('GIT_DIR=%s '.Pluf::f('git_path', 'git').' show %s --name-status --pretty="format:" --diff-filter="[A|D|M|R]"',
$cmd = sprintf('GIT_DIR=%s '.Pluf::f('git_path', 'git').' show %s --name-status --pretty="format:" --diff-filter="[A|D|M|R]" -M',
escapeshellarg($this->repo),
escapeshellarg($commit));
$out = array();
$line = trim($line);
if ($line != '') {
$action = $line[0];
$filename = trim(substr($line, 1));
if ($action == 'A') {
$filename = trim(substr($line, 1));
$return->additions[] = $filename;
} else if ($action == 'D') {
$filename = trim(substr($line, 1));
$return->deletions[] = $filename;
} else if ($action == 'M') {
$filename = trim(substr($line, 1));
$return->patches[] = $filename;
} else if ($action == 'R') {
$return->renames[] = $filename;
$matches = split ("\t", $line);
$return->renames[$matches[1]] = $matches[2];
}
}
}
return $return;
}

Archive Download the corresponding diff file

Page rendered in 0.08111s using 13 queries.