Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose -moveHEAD #535

Merged
merged 5 commits into from
Nov 11, 2015
Merged

Expose -moveHEAD #535

merged 5 commits into from
Nov 11, 2015

Conversation

phatblat
Copy link
Member

Expose move HEAD operations through public API. Includes tests.

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.

Supersedes #515 from @wilshipley

wilshipley and others added 3 commits November 9, 2015 22:35
…veHEADToCommit: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.
@@ -269,6 +269,22 @@ extern NSString * const GTRepositoryInitOptionsOriginURLString;
/// Returns a GTReference or nil if an error occurs.
- (nullable GTReference *)headReferenceWithError:(NSError **)error;

/// Move HEAD reference safely, since deleting and recreating HEAD is always wrong.
///
/// reference - The new target reference for HEAD.
Copy link
Member

Choose a reason for hiding this comment

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

Style nit: could you align the - for the args?

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 this one was missed 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

😲

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

Just a style nit. Thanks!

@phatblat
Copy link
Member Author

you got it dude!

@joshaber
Copy link
Member

@phatblat
Copy link
Member Author

so sorry

@joshaber
Copy link
Member

🤘

joshaber added a commit that referenced this pull request Nov 11, 2015
@joshaber joshaber merged commit 183232f into libgit2:master Nov 11, 2015
@phatblat phatblat deleted the ben/movehead branch November 11, 2015 15:17
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.

3 participants