public function getStagedFiles()
    {
        $base = $this->getProjectBase();

        $files = new FileCollection();

        foreach ($this->getFiles() as $file) {
            $fileData = explode("\t", $file);
            $status = reset($fileData);
            $relativePath = end($fileData);

            $fullPath = rtrim($base . DIRECTORY_SEPARATOR . $relativePath);

            $file = new File($status, $fullPath, $base);
            $this->saveFileToCache($file);
            $files->append($file);
        }

        return $files;
    }
public function getStagedFiles()
    {
        $base = $this->getProjectBase();

        $files = new FileCollection();

        foreach ($this->getFiles() as $file) {
            $fileData = explode("\t", $file);
            $status = reset($fileData);
            $relativePath = end($fileData);

            $fullPath = rtrim($base . DIRECTORY_SEPARATOR . $relativePath);

            $file = new File($status, $fullPath, $base);
            $this->saveFileToCache($file);
            $files->append($file);
        }

        return $files;
    }
public function getStagedFiles ( ) { $ base = $ this -> getProjectBase ( ) ; $ files = new FileCollection ( ) ; foreach ( $ this -> getFiles ( ) as $ file ) { $ fileData = explode ( "\t" , $ file ) ; $ status = reset ( $ fileData ) ; $ relativePath = end ( $ fileData ) ; $ fullPath = rtrim ( $ base . DIRECTORY_SEPARATOR . $ relativePath ) ; $ file = new File ( $ status , $ fullPath , $ base ) ; $ this -> saveFileToCache ( $ file ) ; $ files -> append ( $ file ) ; } return $ files ; }
Gets a list of the files currently staged under git.

Returns either an empty array or a tab separated list of staged files and
their git status.

@link http://git-scm.com/docs/git-status

@return FileCollection
Gets a list of the files currently staged under git .