Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Just playing around with ObjectiveGit.
- MacRuby and Hotcocoa are kind of 'crashy' when I try using things like Grit or Buttons.
- Gonna try building up the basic functionality that is available in my homebrew-web Rakefile here.
- Then work on importing everything into a proper Cocoa app.
- */
- #import "ObjGit.h"
- int main (int argc, char const *argv[])
- {
- NSAutoreleasePool *pool = [NSAutoreleasePool new];
- ObjGit *repo = [[ObjGit alloc] init];
- if([repo openRepo:@"/usr/local/.git"] == TRUE){
- printf("Successfully opened Git repo!\n");
- printf("Git name: %s\n", [[repo gitName] cString]);
- printf("Object Count: %lu\n", [[repo getAllRefs] count]);
- NSArray *refs = [repo getAllRefs];
- unsigned int objectCount = [refs count];
- unsigned int index = 0;
- for(index=0; index < objectCount; index += 1)
- {
- id collection = [refs objectAtIndex:index];
- printf("Object is: %s\n", [[collection objectAtIndex:0] cString]);
- printf("SHA is: %s\n", [[collection objectAtIndex:1] cString]);
- }
- } else {
- printf("Could not open Git repo :(\n");
- }
- [pool release];
- return 0;
- }
Add Comment
Please, Sign In to add comment