Skip to content

Commit 15214e3

Browse files
committed
added argument to GitRepo::rm for using the --cached flag [see kbjr#23]
1 parent 19407ed commit 15214e3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Git.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,15 @@ public function add($files = "*") {
334334
* Accepts a list of files to remove
335335
*
336336
* @access public
337-
* @param mixed files to remove
337+
* @param mixed files to remove
338+
* @param Boolean use the --cached flag?
338339
* @return string
339340
*/
340-
public function rm($files = "*") {
341+
public function rm($files = "*", $cached = false) {
341342
if (is_array($files)) {
342343
$files = '"'.implode('" "', $files).'"';
343344
}
344-
return $this->run("rm $files");
345+
return $this->run("rm ".($cached ? '--cached ' : '').$files);
345346
}
346347

347348

0 commit comments

Comments
 (0)