Skip to content

Commit 5740bfa

Browse files
author
Bruno Moreira De Barros
committed
Fixes an issue that caused problems with uploading files with spaces in their filename.
1 parent 2b5ba0b commit 5740bfa

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,8 @@
7676
"post-autoload-dump": [
7777
"php tools/build.php"
7878
]
79+
},
80+
"require": {
81+
"ext-ftp": "*"
7982
}
8083
}

git-deploy

-13 Bytes
Binary file not shown.

tools/src/Git.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function get_changes($target_commit, $current_commit) {
6868
foreach ($result as $line) {
6969
if ($line[0] == 'A' or $line[0] == 'C' or $line[0] == 'M') {
7070
$path = trim(substr($line, 1, strlen($line)));
71-
$return['upload'][$path] = $this->get_file_contents("$target_commit:\"$path\"");
71+
$return['upload'][$path] = $this->get_file_contents("$target_commit:$path");
7272
} elseif ($line[0] == 'D') {
7373
$return['delete'][] = trim(substr($line, 1, strlen($line)));
7474
} elseif ($line[0] == 'R') {
@@ -106,8 +106,6 @@ public function get_status_towards_remote($local_branch, $remote_branch)
106106
$remote_branch = "@{u}";
107107
}
108108

109-
$status;
110-
111109
$this->exec("remote update");
112110

113111
$local = $this->exec("rev-parse ".$local_branch);
@@ -136,7 +134,7 @@ public function get_status_towards_remote($local_branch, $remote_branch)
136134

137135
protected function get_file_contents($path) {
138136
$temp = tempnam(sys_get_temp_dir(), "git-deploy-");
139-
$this->exec('show "' . $path . '"', "> \"$temp\"");
137+
$this->exec('show ' . escapeshellarg($path), "> \"$temp\"");
140138
return file_get_contents($temp);
141139
}
142140

0 commit comments

Comments
 (0)