Skip to content

Commit 24e8a7d

Browse files
committed
Don't go through an enumerator to grab a test commit's parent
1 parent cdb48ec commit 24e8a7d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ObjectiveGitTests/GTUtilityFunctions.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@
2626

2727
// We need the parent commit to make the new one
2828
GTReference *headReference = [repo headReferenceWithError:nil];
29-
30-
GTEnumerator *commitEnum = [[GTEnumerator alloc] initWithRepository:repo error:nil];
31-
[commitEnum pushSHA:[headReference targetOID].SHA error:nil];
32-
GTCommit *parent = [commitEnum nextObject];
29+
GTCommit *parent = [repo lookUpObjectByOID:[headReference targetOID] objectType:GTObjectTypeCommit error:NULL];
3330

3431
GTCommit *testCommit = [repo createCommitWithTree:testTree message:message parents:@[ parent ] updatingReferenceNamed:headReference.name error:nil];
3532
expect(testCommit).notTo(beNil());

0 commit comments

Comments
 (0)