mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Use the newer libgit2 method for extracting a hex digest from an object id.
This commit is contained in:
committed by
André Berg
parent
a2ebc4a4fd
commit
611687e7c5
+9
-4
@@ -22,9 +22,11 @@
|
||||
NSMutableArray *p = [NSMutableArray arrayWithCapacity:nParents];
|
||||
for (i = 0; i < nParents; ++i)
|
||||
{
|
||||
char *s = git_oid_mkhex(parentShas + i);
|
||||
char s[41];
|
||||
git_oid_fmt(s, parentShas + i);
|
||||
s[40] = 0;
|
||||
[p addObject:[NSString stringWithUTF8String:s]];
|
||||
free(s);
|
||||
// free(s);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
@@ -121,9 +123,12 @@
|
||||
|
||||
- (NSString *)realSha
|
||||
{
|
||||
char *hex = git_oid_mkhex(&sha);
|
||||
char hex[41];
|
||||
git_oid_fmt(hex, &sha);
|
||||
hex[40] = 0;
|
||||
// char *hex = git_oid_mkhex(&sha);
|
||||
NSString *str = [NSString stringWithUTF8String:hex];
|
||||
free(hex);
|
||||
// free(hex);
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user