summaryrefslogtreecommitdiff
path: root/src/reader.h
Commit message (Collapse)AuthorAgeFilesLines
* apply: handle exact renamesEdward Thomson2018-11-051-1/+2
| | | | | | | Deltas containing exact renames are special; they simple indicate that a file was renamed without providing additional metadata (like the filemode). Teach the reader to provide the file mode and use the preimage's filemode in the case that the delta does not provide one.)
* reader: free is unused and unnecessaryEdward Thomson2018-11-051-1/+0
| | | | | None of the reader implementations actually allocate anything themselves, so they don't need a free function. Remove it.
* reader: optionally validate index matches workdirEdward Thomson2018-11-051-1/+5
| | | | | When using a workdir reader, optionally validate that the index contents match the working directory contents.
* apply: use preimage as the checkout baselineEdward Thomson2018-11-051-1/+2
| | | | | | | | | | | | | | | | Use the preimage as the checkout's baseline. This allows us to support applying patches to files that are modified in the working directory (those that differ from the HEAD and index). Without this, files will be reported as (checkout) conflicts. With this, we expect the on-disk data when we began the patch application (the "preimage") to be on-disk during checkout. We could have also simply used the `FORCE` flag to checkout to accomplish a similar mechanism. However, `FORCE` ignores all differences, while providing a preimage ensures that we will only overwrite the file contents that we actually read. Modify the reader interface to provide the OID to support this.
* reader: a generic way to read files from reposEdward Thomson2018-11-041-0/+102
Similar to the `git_iterator` interface, the `git_reader` interface will allow us to read file contents from an arbitrary repository-backed data source (trees, index, or working directory).