Support pushing data into Git LFS

Summary:
Ref T7789. Ref T10604. This implements the `upload` action, which streams file data into Files.

This makes Git LFS actually work, at least roughly.

Test Plan:
  - Tracked files in an LFS repository.
  - Pushed LFS data (`git lfs track '*.png'; git add something.png; git commit -m ...; git push`).
  - Pulled LFS data (`git checkout master^; rm -rf .git/lfs; git checkout master; open something.png`).
  - Verified LFS refs show up in the gitlfsref table.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7789, T10604

Differential Revision: https://secure.phabricator.com/D15492
This commit is contained in:
epriestley
2016-03-18 06:22:37 -07:00
parent f07d0ae7c3
commit a24f001b08
4 changed files with 129 additions and 5 deletions

View File

@@ -72,7 +72,9 @@ abstract class PhabricatorFileUploadSource
$data->rewind();
$this->didRewind = true;
} else {
$data->next();
if ($data->valid()) {
$data->next();
}
}
if (!$data->valid()) {