(statusEntry *C.git_status_entry)
| 36 | } |
| 37 | |
| 38 | func statusEntryFromC(statusEntry *C.git_status_entry) StatusEntry { |
| 39 | var headToIndex DiffDelta = DiffDelta{} |
| 40 | var indexToWorkdir DiffDelta = DiffDelta{} |
| 41 | |
| 42 | // Based on the libgit2 status example, head_to_index can be null in some cases |
| 43 | if statusEntry.head_to_index != nil { |
| 44 | headToIndex = diffDeltaFromC(statusEntry.head_to_index) |
| 45 | } |
| 46 | if statusEntry.index_to_workdir != nil { |
| 47 | indexToWorkdir = diffDeltaFromC(statusEntry.index_to_workdir) |
| 48 | } |
| 49 | |
| 50 | return StatusEntry{ |
| 51 | Status: Status(statusEntry.status), |
| 52 | HeadToIndex: headToIndex, |
| 53 | IndexToWorkdir: indexToWorkdir, |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | type StatusList struct { |
| 58 | doNotCompare |
no test coverage detected
searching dependent graphs…