Skip to content

Diff Line Model Object #112

merged 8 commits into from Dec 21, 2012

4 participants


When using the new diff API it was pretty inconvenient that we didn't actually represent a line as a model object at any point, but rather just passed all of it's components separately into the enumeration block.

This changes that, representing a line as an object.

@joshaber joshaber was assigned Dec 20, 2012

Looks pretty good to me. Could do with some unit tests for the new class though. (yes I'm back 💃)

@jspahrsummers jspahrsummers and 1 other commented on an outdated diff Dec 21, 2012
+// A character representing the origin of a given line.
+// See diff.h for individual documentation.
+typedef enum : git_diff_line_t {
+ GTDiffLineOriginContext = GIT_DIFF_LINE_CONTEXT,
+ GTDiffLineOriginAddition = GIT_DIFF_LINE_ADDITION,
+ GTDiffLineOriginDeletion = GIT_DIFF_LINE_DELETION,
+ GTDiffLineOriginDeleteEOFNewLine = GIT_DIFF_LINE_DEL_EOFNL,
+} GTDiffLineOrigin;
+// Represents an individual line in a diff hunk.
+@interface GTDiffLine : NSObject
+// The content string of the line.
+@property (nonatomic, readonly) NSString *content;
dannygreg added a note Dec 21, 2012

Nice catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

@alanjrogers it isn't split out, but this is unit tested in the diff unit tests. Although the more the merrier I guess :p




Looks good to me.



I presumed he was a 👍 with his above comment.


I'd like to give him the opportunity to reply about the tests.


I feel the need for :shipit:


You can just pin to this branch from your other work. :P


Yeah I already am but it's not quite like a PR getting merged man. It's my crack. :p

@alanjrogers alanjrogers merged commit 0bbc548 into master Dec 21, 2012
@alanjrogers alanjrogers deleted the diff-line branch Dec 21, 2012

Crack administered 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.