Skip to content

Commit 2d9cda6

Browse files
committed
Merge branch 'master' of github.com:BrunoDeBarros/git-deploy-php
2 parents 15c7b1f + 05f2362 commit 2d9cda6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

git-deploy

100755100644
-1.22 MB
Binary file not shown.

tools/src/Git.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ public function get_changes($target_commit, $current_commit) {
7171
$return['upload'][$path] = $this->get_file_contents("$target_commit:\"$path\"");
7272
} elseif ($line[0] == 'D') {
7373
$return['delete'][] = trim(substr($line, 1, strlen($line)));
74+
} elseif ($line[0] == 'R') {
75+
$details = preg_split("/\\s+/", $line);
76+
$return['delete'][] = $details[1];
77+
$return['upload'][] = $details[2];
7478
} else {
7579
Helpers::error("Unknown git-diff status: {$line[0]}");
7680
}
@@ -88,7 +92,7 @@ public function get_changes($target_commit, $current_commit) {
8892

8993
protected function get_file_contents($path) {
9094
$temp = tempnam(sys_get_temp_dir(), "git-deploy-");
91-
$this->exec('show "' . $path . '"', "> \"$temp\"");
95+
$this->exec('show ' . escapeshellarg($path), "> \"$temp\"");
9296
return file_get_contents($temp);
9397
}
9498

0 commit comments

Comments
 (0)