Skip to content

Conversation

@sagmor
Copy link
Contributor

@sagmor sagmor commented Apr 9, 2015

Hi,

I added support for libgit2 git_index_add_frombuffer function on GTIndex with the following methods:

// - (NSData *)dataWithName:(NSString *)name error:(NSError **)error; (removed)
- (BOOL)addData:(NSData *)data withName:(NSString *)name error:(NSError **)error;

I still have to add some documentation and need to make it work with an inMemoryIndexWithRepository:error:

Also I had to update External/libgit2 to get the method, not sure if there's an issue with this.
Right now GTIndexSpec is passing but have failing specs at GTConfigurationSpec and GTRemoteSpec

So, I'm still working on it but I'm pushing this in case you find something fishy (specially with the updated dependency and the two failing specs)

@sagmor
Copy link
Contributor Author

sagmor commented Apr 9, 2015

I think I will move the data fetching to GTIndexEntry to make it work more like GTTreeEntry for API consistency.

@sagmor
Copy link
Contributor Author

sagmor commented Apr 10, 2015

Now this is working better.

The only problem I'm having is that this doesn't work with in memory indexes because git_index_add_frombuffer fetches the repository from the struct's rc.owner property which looks like it can't be set without touching libgit2.

Let me know if you see any issue with this PR 👍

@joshaber joshaber self-assigned this Apr 10, 2015
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like these can't be nil according to the implementation. Could we document that?

@joshaber
Copy link
Member

Awesome, thanks! 🍻

The only problem I'm having is that this doesn't work with in memory indexes because git_index_add_frombuffer fetches the repository from the struct's rc.owner property which looks like it can't be set without touching libgit2.

No worries. Just a couple other notes.

@sagmor
Copy link
Contributor Author

sagmor commented Apr 10, 2015

There it is 😄

I addressed those notes and a couple more I found around

@joshaber
Copy link
Member

🤘

Thanks!

joshaber added a commit that referenced this pull request Apr 13, 2015
@joshaber joshaber merged commit a2de081 into libgit2:master Apr 13, 2015
@sagmor
Copy link
Contributor Author

sagmor commented Apr 13, 2015

Cool 👍

@sagmor sagmor deleted the index_add_frombuffer branch April 13, 2015 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants