Skip to content

Commit c916c74

Browse files
wilshipleyphatblat
authored andcommitted
Moved private method declarations -moveHEADToReference:error: and -moveHEADToCommit:error: to the header so they can be used from apps. This seems important because I'm told the only legitimate way to move the HEAD is with these methods (and the underlying git2 functions) and NOT to delete and recreate the HEAD reference manually, so these methods must be public if client apps need to move the HEAD.
1 parent bb058d0 commit c916c74

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ObjectiveGit/GTRepository.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,14 @@ extern NSString * const GTRepositoryInitOptionsOriginURLString;
269269
/// Returns a GTReference or nil if an error occurs.
270270
- (nullable GTReference *)headReferenceWithError:(NSError **)error;
271271

272+
/// Move HEAD reference safely, since deleting and recreating HEAD is always wrong
273+
///
274+
/// error - If not NULL, set to any error that occurs.
275+
///
276+
/// Returns NO if an error occurs.
277+
- (BOOL)moveHEADToReference:(GTReference *)reference error:(NSError **)error;
278+
- (BOOL)moveHEADToCommit:(GTCommit *)commit error:(NSError **)error;
279+
272280
/// Get the local branches.
273281
///
274282
/// error - If not NULL, set to any error that occurs.

0 commit comments

Comments
 (0)