Skip to content

Commit 49aff09

Browse files
committed
Added commit_all argument to Repo::commit
Now the -a flag can be overridden when calling Repo::commit by passing in a second parameter false, eg. $repo->commit('commit message here', false);
1 parent 2f416c1 commit 49aff09

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Git.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,12 @@ public function rm($files = "*", $cached = false) {
372372
*
373373
* @access public
374374
* @param string commit message
375+
* @param boolean should all files be committed automatically (-a flag)
375376
* @return string
376377
*/
377-
public function commit($message = "") {
378-
return $this->run("commit -av -m ".escapeshellarg($message));
378+
public function commit($message = "", $commit_all = true) {
379+
var flags = $commit_all ? '-av' : '-v';
380+
return $this->run("commit '.$flags.' -m ".escapeshellarg($message));
379381
}
380382

381383
/**

0 commit comments

Comments
 (0)