@@ -68,7 +68,7 @@ public function get_changes($target_commit, $current_commit) {
68
68
foreach ($ result as $ line ) {
69
69
if ($ line [0 ] == 'A ' or $ line [0 ] == 'C ' or $ line [0 ] == 'M ' ) {
70
70
$ 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 " );
72
72
} elseif ($ line [0 ] == 'D ' ) {
73
73
$ return ['delete ' ][] = trim (substr ($ line , 1 , strlen ($ line )));
74
74
} elseif ($ line [0 ] == 'R ' ) {
@@ -106,8 +106,6 @@ public function get_status_towards_remote($local_branch, $remote_branch)
106
106
$ remote_branch = "@{u} " ;
107
107
}
108
108
109
- $ status ;
110
-
111
109
$ this ->exec ("remote update " );
112
110
113
111
$ local = $ this ->exec ("rev-parse " .$ local_branch );
@@ -136,7 +134,7 @@ public function get_status_towards_remote($local_branch, $remote_branch)
136
134
137
135
protected function get_file_contents ($ path ) {
138
136
$ temp = tempnam (sys_get_temp_dir (), "git-deploy- " );
139
- $ this ->exec ('show " ' . $ path . ' " ' , "> \"$ temp \"" );
137
+ $ this ->exec ('show ' . escapeshellarg ( $ path) , "> \"$ temp \"" );
140
138
return file_get_contents ($ temp );
141
139
}
142
140
0 commit comments