backend/components/AGitRepository.php
/**
	 * Makes a git commit
	 * @param string $message the commit message
	 * @param boolean $addFiles whether to add changes from all known files
	 * @param boolean $amend whether the commit
	 * @return array|false an array of committed files, file => status, or false if the commit failed
	 */
Makes a git commit
@param string $message the commit message
@param boolean $addFiles whether to add changes from all known files
@param boolean $amend whether the commit
@return array|false an array of committed files, file => status, or false if the commit failed
Makes a git commit @param string $message the commit message @param boolean $addFiles whether to add changes from all known files @param boolean $amend whether the commit @return array|false an array of committed files file = > status or false if the commit failed
public function commit($message = null, $addFiles = false, $amend = false)
	{
		$command = "commit ";
		if ($addFiles) {
			$command .= "-a ";
		}
		if ($amend) {
			$command .= "--amend";
		}
		if ($message) {
			$command .= '-m "'.$message.'"';
		}
		$result = $this->run($command." --porcelain");
		if (!$result) {
			return false;
		}
		$this->run($command);
		$files = array();
		foreach(explode("\n",$result) as $line) {
			$status = trim(substr($line,0,3));
			$file = trim(substr($line,3));
			$files[$file] = $status;
		}
		$this->_branches = null;
		return $files;
	}
public function commit ( $ message = null , $ addFiles = false , $ amend = false ) { $ command = " commit  " ; if ( $ addFiles ) { $ command .= " -a  " ; } if ( $ amend ) { $ command .= " --amend " ; } if ( $ message ) { $ command .= '-m "' . $ message . '"' ; } $ result = $ this -> run ( $ command . "  --porcelain " ) ; if ( ! $ result ) { return false ; } $ this -> run ( $ command ) ; $ files = array ( ) ; foreach ( explode ( " \n " , $ result ) as $ line ) { $ status = trim ( substr ( $ line , 0 , 3 ) ) ; $ file = trim ( substr ( $ line , 3 ) ) ; $ files [ $ file ] = $ status ; } $ this -> _branches = null ; return $ files ; }
Makes a git commit
 @param string $message the commit message
 @param boolean $addFiles whether to add changes from all known files
 @param boolean $amend whether the commit
 @return array|false an array of committed files, file => status, or false if the commit failed
Makes a git commit @param string $message the commit message @param boolean $addFiles whether to add changes from all known files @param boolean $amend whether the commit @return array|false an array of committed files file = > status or false if the commit failed