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

Mark NS_DESIGNATED_INITIALIZER methods #449

Merged
merged 2 commits into from
Mar 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ObjectiveGit/GTBlame.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@interface GTBlame : NSObject

/// Designated initializer.
- (instancetype)initWithGitBlame:(git_blame *)blame;
- (instancetype)initWithGitBlame:(git_blame *)blame NS_DESIGNATED_INITIALIZER;

/// Get all the hunks in the blame. A convenience wrapper around `enumerateHunksUsingBlock:`
@property (nonatomic, strong, readonly) NSArray *hunks;
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTBlameHunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/// A `GTBlameHunk` is an object that provides authorship info for a set of lines in a `GTBlame`.
@interface GTBlameHunk : NSObject

- (instancetype)initWithGitBlameHunk:(git_blame_hunk)hunk;
- (instancetype)initWithGitBlameHunk:(git_blame_hunk)hunk NS_DESIGNATED_INITIALIZER;

/// A NSRange where `location` is the (1 based) starting line number,
/// and `length` is the number of lines in the hunk.
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTBranch.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typedef NS_ENUM(NSInteger, GTBranchType) {
+ (NSString *)localNamePrefix;
+ (NSString *)remoteNamePrefix;

- (id)initWithReference:(GTReference *)ref repository:(GTRepository *)repo;
- (id)initWithReference:(GTReference *)ref repository:(GTRepository *)repo NS_DESIGNATED_INITIALIZER;
+ (id)branchWithReference:(GTReference *)ref repository:(GTRepository *)repo;

/// Get the target commit for this branch
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTConfiguration+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
/// repository - The repository in which the config resides. May be nil.
///
/// Returns the initialized object.
- (id)initWithGitConfig:(git_config *)config repository:(GTRepository *)repository;
- (id)initWithGitConfig:(git_config *)config repository:(GTRepository *)repository NS_DESIGNATED_INITIALIZER;

@end
2 changes: 1 addition & 1 deletion ObjectiveGit/GTDiff.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ typedef NS_OPTIONS(NSInteger, GTDiffFindOptionsFlags) {
/// repository - The repository in which the diff lives. Cannot be nil.
///
/// Returns the initialized object.
- (instancetype)initWithGitDiff:(git_diff *)diff repository:(GTRepository *)repository;
- (instancetype)initWithGitDiff:(git_diff *)diff repository:(GTRepository *)repository NS_DESIGNATED_INITIALIZER;

/// The libgit2 diff object.
- (git_diff *)git_diff __attribute__((objc_returns_inner_pointer));
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTDiffDelta.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ @interface GTDiffDelta ()
/// the given diff delta. Must not be nil.
///
/// This is the designated initializer for this class.
- (instancetype)initWithGitDiffDeltaBlock:(git_diff_delta (^)(void))deltaAccessor patchGeneratorBlock:(int (^)(git_patch **patch))patchGenerator;
- (instancetype)initWithGitDiffDeltaBlock:(git_diff_delta (^)(void))deltaAccessor patchGeneratorBlock:(int (^)(git_patch **patch))patchGenerator NS_DESIGNATED_INITIALIZER;

@end

Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTDiffFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ typedef NS_OPTIONS(NSInteger, GTDiffFileFlag) {
/// file - The git_diff_file wrapped by the receiver.
///
/// Returns an initialized GTDiffFile.
- (instancetype)initWithGitDiffFile:(git_diff_file)file;
- (instancetype)initWithGitDiffFile:(git_diff_file)file NS_DESIGNATED_INITIALIZER;

@end
2 changes: 1 addition & 1 deletion ObjectiveGit/GTDiffHunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
///
/// The contents of a hunk are lazily loaded, therefore we initialise the object
/// simply with the patch it originates from and which hunk index it represents.
- (instancetype)initWithPatch:(GTDiffPatch *)patch hunkIndex:(NSUInteger)hunkIndex;
- (instancetype)initWithPatch:(GTDiffPatch *)patch hunkIndex:(NSUInteger)hunkIndex NS_DESIGNATED_INITIALIZER;

/// Perfoms the given block on each line in the hunk.
///
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTDiffLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ typedef NS_ENUM(char, GTDiffLineOrigin) {
@property (nonatomic, readonly) NSInteger lineCount;

/// Designated initialiser.
- (instancetype)initWithGitLine:(const git_diff_line *)line;
- (instancetype)initWithGitLine:(const git_diff_line *)line NS_DESIGNATED_INITIALIZER;

@end
2 changes: 1 addition & 1 deletion ObjectiveGit/GTDiffPatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
/// automatically be freed when the receiver is deallocated. Must not be
/// NULL.
/// delta - The diff delta corresponding to this patch. Must not be nil.
- (instancetype)initWithGitPatch:(git_patch *)patch delta:(GTDiffDelta *)delta;
- (instancetype)initWithGitPatch:(git_patch *)patch delta:(GTDiffDelta *)delta NS_DESIGNATED_INITIALIZER;

/// Returns the underlying patch object.
- (git_patch *)git_patch __attribute__((objc_returns_inner_pointer));
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTEnumerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ typedef NS_OPTIONS(unsigned int, GTEnumeratorOptions) {
/// error - If not NULL, set to any error that occurs.
///
/// Returns an initialized enumerator, or nil if an error occurs.
- (id)initWithRepository:(GTRepository *)repo error:(NSError **)error;
- (id)initWithRepository:(GTRepository *)repo error:(NSError **)error NS_DESIGNATED_INITIALIZER;

/// Marks a commit to start traversal from.
///
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTFetchHeadEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
/// remoteURLString - URL String where this was originally fetched from. Cannot be nil.
/// targetOID - Target OID. Cannot be nil.
/// merge - Indicates if this is pending a merge.
- (instancetype)initWithReference:(GTReference *)reference remoteURLString:(NSString *)remoteURLString targetOID:(GTOID *)targetOID isMerge:(BOOL)merge;
- (instancetype)initWithReference:(GTReference *)reference remoteURLString:(NSString *)remoteURLString targetOID:(GTOID *)targetOID isMerge:(BOOL)merge NS_DESIGNATED_INITIALIZER;

@end
2 changes: 1 addition & 1 deletion ObjectiveGit/GTFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extern const NSInteger GTFilterErrorNameAlreadyRegistered;
/// applyBlock - The block to use to apply the filter. Cannot be nil.
///
/// Returns the initialized object.
- (id)initWithName:(NSString *)name attributes:(NSString *)attributes applyBlock:(NSData * (^)(void **payload, NSData *from, GTFilterSource *source, BOOL *applied))applyBlock;
- (id)initWithName:(NSString *)name attributes:(NSString *)attributes applyBlock:(NSData * (^)(void **payload, NSData *from, GTFilterSource *source, BOOL *applied))applyBlock NS_DESIGNATED_INITIALIZER;

/// Look up a filter based on its name.
///
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTFilterList.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ typedef NS_OPTIONS(NSInteger, GTFilterListOptions) {
/// filterList - The filter list to wrap and take ownership of. This filter list
/// will be automatically disposed when the receiver deallocates.
/// Must not be NULL.
- (instancetype)initWithGitFilterList:(git_filter_list *)filterList;
- (instancetype)initWithGitFilterList:(git_filter_list *)filterList NS_DESIGNATED_INITIALIZER;

/// Returns the underlying `git_filter_list`.
- (git_filter_list *)git_filter_list __attribute__((objc_returns_inner_pointer));
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTFilterSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ typedef NS_ENUM(NSInteger, GTFilterSourceMode) {
/// source - The filter source. Cannot be NULL.
///
/// Returns the initialized object.
- (id)initWithGitFilterSource:(const git_filter_source *)source;
- (id)initWithGitFilterSource:(const git_filter_source *)source NS_DESIGNATED_INITIALIZER;

@end
2 changes: 1 addition & 1 deletion ObjectiveGit/GTIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
/// repository - The repository in which the index resides. Cannot be nil.
///
/// Returns the initialized index.
- (instancetype)initWithGitIndex:(git_index *)index repository:(GTRepository *)repository;
- (instancetype)initWithGitIndex:(git_index *)index repository:(GTRepository *)repository NS_DESIGNATED_INITIALIZER;

/// The underlying `git_index` object.
- (git_index *)git_index __attribute__((objc_returns_inner_pointer));
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTIndexEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ typedef NS_ENUM(NSInteger, GTIndexEntryStatus) {
/// entry - The libgit2 index entry. Cannot be NULL.
///
/// Returns the initialized object.
- (id)initWithGitIndexEntry:(const git_index_entry *)entry;
- (id)initWithGitIndexEntry:(const git_index_entry *)entry NS_DESIGNATED_INITIALIZER;

/// The underlying `git_index_entry` object.
- (const git_index_entry *)git_index_entry __attribute__((objc_returns_inner_pointer));
Expand Down
4 changes: 2 additions & 2 deletions ObjectiveGit/GTOID.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/// git_oid - The underlying git_oid. Cannot be NULL.
///
/// Returns the initialized receiver.
- (id)initWithGitOid:(const git_oid *)git_oid;
- (id)initWithGitOid:(const git_oid *)git_oid NS_DESIGNATED_INITIALIZER;

/// Initializes the receiver by converting the given SHA to an OID.
///
Expand Down Expand Up @@ -57,7 +57,7 @@
/// error - Will be filled with an error object in if the SHA cannot be parsed
///
/// Returns the initialized receiver.
- (id)initWithSHACString:(const char *)string error:(NSError **)error;
- (id)initWithSHACString:(const char *)string error:(NSError **)error NS_DESIGNATED_INITIALIZER;

/// Creates a new instance with the given git_oid using initWithGitOid:
+ (instancetype)oidWithGitOid:(const git_oid *)git_oid;
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ typedef NS_ENUM(int, GTObjectType) {
@property (nonatomic, readonly) GTOID *OID;

/// Convenience initializers
- (id)initWithObj:(git_object *)theObject inRepository:(GTRepository *)theRepo;
- (id)initWithObj:(git_object *)theObject inRepository:(GTRepository *)theRepo NS_DESIGNATED_INITIALIZER;
+ (id)objectWithObj:(git_object *)theObject inRepository:(GTRepository *)theRepo;

/// The underlying `git_object`.
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTObjectDatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
/// error - The error if one occurred.
///
/// Returns the initialized object.
- (id)initWithRepository:(GTRepository *)repo error:(NSError **)error;
- (id)initWithRepository:(GTRepository *)repo error:(NSError **)error NS_DESIGNATED_INITIALIZER;

/// The underlying `git_odb` object.
- (git_odb *)git_odb __attribute__((objc_returns_inner_pointer));
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTOdbObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/// repository - The repository in which the object resides. Cannot be nil.
///
/// Returns the initialized object.
- (id)initWithOdbObj:(git_odb_object *)object repository:(GTRepository *)repository;
- (id)initWithOdbObj:(git_odb_object *)object repository:(GTRepository *)repository NS_DESIGNATED_INITIALIZER;

/// The underlying `git_odb_object`.
- (git_odb_object *)git_odb_object __attribute__((objc_returns_inner_pointer));
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTReference.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ typedef NS_OPTIONS(NSInteger, GTReferenceType) {
+ (id)referenceByResolvingSymbolicReference:(GTReference *)symbolicRef error:(NSError **)error;
- (id)initByResolvingSymbolicReference:(GTReference *)symbolicRef error:(NSError **)error;

- (id)initWithGitReference:(git_reference *)ref repository:(GTRepository *)repository;
- (id)initWithGitReference:(git_reference *)ref repository:(GTRepository *)repository NS_DESIGNATED_INITIALIZER;

/// The underlying `git_reference` object.
- (git_reference *)git_reference __attribute__((objc_returns_inner_pointer));
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTReflog+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
/// reference - The reference whose reflog is being represented. Cannot be nil.
///
/// Returns the initialized object.
- (id)initWithReference:(GTReference *)reference;
- (id)initWithReference:(GTReference *)reference NS_DESIGNATED_INITIALIZER;

@end
2 changes: 1 addition & 1 deletion ObjectiveGit/GTReflogEntry+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
/// reflog - The reflog in which the entry resides. Cannot be nil.
///
/// Returns the initialized object.
- (id)initWithGitReflogEntry:(const git_reflog_entry *)entry reflog:(GTReflog *)reflog;
- (id)initWithGitReflogEntry:(const git_reflog_entry *)entry reflog:(GTReflog *)reflog NS_DESIGNATED_INITIALIZER;

@end
2 changes: 1 addition & 1 deletion ObjectiveGit/GTRemote.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ typedef enum {
///
/// remote - The underlying `git_remote` object. Cannot be nil.
/// repo - The repository the remote belongs to. Cannot be nil.
- (instancetype)initWithGitRemote:(git_remote *)remote inRepository:(GTRepository *)repo;
- (instancetype)initWithGitRemote:(git_remote *)remote inRepository:(GTRepository *)repo NS_DESIGNATED_INITIALIZER;

/// The underlying `git_remote` object.
- (git_remote *)git_remote __attribute__((objc_returns_inner_pointer));
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTRepository.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ extern NSString * const GTRepositoryInitOptionsOriginURLString;
/// after this method is invoked. This must not be nil.
///
/// Returns an initialized GTRepository.
- (id)initWithGitRepository:(git_repository *)repository;
- (id)initWithGitRepository:(git_repository *)repository NS_DESIGNATED_INITIALIZER;

/// The underlying `git_repository` object.
- (git_repository *)git_repository __attribute__((objc_returns_inner_pointer));
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTStatusDelta.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ typedef NS_ENUM(NSInteger, GTStatusDeltaStatus) {
@property (nonatomic, readonly) double similarity;

/// Designated initializer.
- (instancetype)initWithGitDiffDelta:(const git_diff_delta *)delta;
- (instancetype)initWithGitDiffDelta:(const git_diff_delta *)delta NS_DESIGNATED_INITIALIZER;

@end
2 changes: 1 addition & 1 deletion ObjectiveGit/GTSubmodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ typedef NS_OPTIONS(NSInteger, GTSubmoduleStatus) {
/// nil.
///
/// Returns an initialized GTSubmodule, or nil if an error occurs.
- (id)initWithGitSubmodule:(git_submodule *)submodule parentRepository:(GTRepository *)repository;
- (id)initWithGitSubmodule:(git_submodule *)submodule parentRepository:(GTRepository *)repository NS_DESIGNATED_INITIALIZER;

/// The underlying `git_submodule` object.
- (git_submodule *)git_submodule __attribute__((objc_returns_inner_pointer));
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTTreeBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ typedef NS_ENUM(NSInteger, GTFileMode) {
/// error - The error if one occurred.
///
/// Returns the initialized object, or nil if an error occurred.
- (id)initWithTree:(GTTree *)treeOrNil repository:(GTRepository *)repository error:(NSError **)error;
- (id)initWithTree:(GTTree *)treeOrNil repository:(GTRepository *)repository error:(NSError **)error NS_DESIGNATED_INITIALIZER;

/// The underlying `git_treebuilder` object.
- (git_treebuilder *)git_treebuilder __attribute__((objc_returns_inner_pointer));
Expand Down