Skip to content

Commit 083a733

Browse files
committed
Merge pull request #477 from javiertoledo/the-fix-i-think-that-makes-sense-for-xcode7-complains
Added NS_UNAVAILABLE flag to all unneeded super initializers (NSObject init)
2 parents 5505fc3 + ca0346f commit 083a733

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+196
-0
lines changed

ObjectiveGit/GTBlame.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ NS_ASSUME_NONNULL_BEGIN
1717
/// A `GTBlame` provides authorship info, through `GTBlameHunk` for each line of a file. Analogous to `git_blame` in libgit2.
1818
@interface GTBlame : NSObject
1919

20+
- (instancetype)init NS_UNAVAILABLE;
21+
2022
/// Designated initializer.
2123
///
2224
/// blame - A git_blame to wrap. May not be NULL.

ObjectiveGit/GTBlame.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ @interface GTBlame ()
2121

2222
@implementation GTBlame
2323

24+
- (instancetype)init {
25+
NSAssert(NO, @"Call to an unavailable initializer.");
26+
return nil;
27+
}
28+
2429
- (instancetype)initWithGitBlame:(git_blame *)blame {
2530
NSParameterAssert(blame != NULL);
2631

ObjectiveGit/GTBlameHunk.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ NS_ASSUME_NONNULL_BEGIN
1717
/// A `GTBlameHunk` is an object that provides authorship info for a set of lines in a `GTBlame`.
1818
@interface GTBlameHunk : NSObject
1919

20+
- (instancetype)init NS_UNAVAILABLE;
21+
2022
/// Designated initializer.
2123
///
2224
/// hunk - A git_blame_hunk to wrap. May not be NULL.

ObjectiveGit/GTBlameHunk.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212

1313
@implementation GTBlameHunk
1414

15+
- (instancetype)init {
16+
NSAssert(NO, @"Call to an unavailable initializer.");
17+
return nil;
18+
}
19+
1520
- (instancetype)initWithGitBlameHunk:(git_blame_hunk)hunk {
1621
self = [super init];
1722
if (self == nil) return nil;

ObjectiveGit/GTBranch.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ NS_ASSUME_NONNULL_BEGIN
5454
+ (NSString *)localNamePrefix;
5555
+ (NSString *)remoteNamePrefix;
5656

57+
- (instancetype)init NS_UNAVAILABLE;
58+
5759
/// Designated initializer.
5860
///
5961
/// ref - The branch reference to wrap. Must not be nil.

ObjectiveGit/GTBranch.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ + (nullable instancetype)branchWithReference:(GTReference *)ref repository:(GTRe
6969
return [[self alloc] initWithReference:ref repository:repo];
7070
}
7171

72+
- (instancetype)init {
73+
NSAssert(NO, @"Call to an unavailable initializer.");
74+
return nil;
75+
}
76+
7277
- (nullable instancetype)initWithReference:(GTReference *)ref repository:(GTRepository *)repo {
7378
NSParameterAssert(ref != nil);
7479
NSParameterAssert(repo != nil);

ObjectiveGit/GTConfiguration.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ NS_ASSUME_NONNULL_BEGIN
2323
/// repository, this will always be nil.
2424
@property (nonatomic, readonly, copy, nullable) NSArray *remotes;
2525

26+
- (instancetype)init NS_UNAVAILABLE;
27+
2628
/// Creates and returns a configuration which includes the global, XDG, and
2729
/// system configurations.
2830
+ (nullable instancetype)defaultConfiguration;

ObjectiveGit/GTConfiguration.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ - (void)dealloc {
3333
}
3434
}
3535

36+
- (instancetype)init {
37+
NSAssert(NO, @"Call to an unavailable initializer.");
38+
return nil;
39+
}
40+
3641
- (instancetype)initWithGitConfig:(git_config *)config repository:(GTRepository *)repository {
3742
NSParameterAssert(config != NULL);
3843

ObjectiveGit/GTDiff.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ NS_ASSUME_NONNULL_BEGIN
259259
/// Returns a newly created GTDiff, or nil if an error occurred.
260260
+ (nullable instancetype)diffWorkingDirectoryToHEADInRepository:(GTRepository *)repository options:(nullable NSDictionary *)options error:(NSError **)error;
261261

262+
- (instancetype)init NS_UNAVAILABLE;
263+
262264
/// Designated initialiser.
263265
///
264266
/// diff - The diff to represent. Cannot be NULL.

ObjectiveGit/GTDiff.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ + (instancetype)diffWorkingDirectoryToHEADInRepository:(GTRepository *)repositor
156156
return HEADIndexDiff;
157157
}
158158

159+
- (instancetype)init {
160+
NSAssert(NO, @"Call to an unavailable initializer.");
161+
return nil;
162+
}
163+
159164
- (instancetype)initWithGitDiff:(git_diff *)diff repository:(GTRepository *)repository {
160165
NSParameterAssert(diff != NULL);
161166
NSParameterAssert(repository != nil);

0 commit comments

Comments
 (0)