Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/git-up/GitUp
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Mar 5, 2024
2 parents e80fd56 + 1ec89dd commit 3f0bcc5
Show file tree
Hide file tree
Showing 19 changed files with 196 additions and 48 deletions.
2 changes: 1 addition & 1 deletion GitUp/Application/Document.m
Original file line number Diff line number Diff line change
Expand Up @@ -1792,7 +1792,7 @@ - (void)setSnapshotToggleState:(NSControlStateValue)state {
XLOG_ERROR(@"This used to be a button, update this function if the layout has changed.");
return;
}

[button setState:state];
}

Expand Down
4 changes: 2 additions & 2 deletions GitUp/GitUp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.3.5;
MARKETING_VERSION = 1.4.0;
PRODUCT_BUNDLE_IDENTIFIER = "co.gitup.mac-debug";
PRODUCT_NAME = GitUp;
};
Expand All @@ -655,7 +655,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.3.5;
MARKETING_VERSION = 1.4.0;
PRODUCT_BUNDLE_IDENTIFIER = co.gitup.mac;
PRODUCT_NAME = GitUp;
};
Expand Down
2 changes: 1 addition & 1 deletion GitUpKit/Components/GIDiffFilesViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ - (NSInteger)numberOfRowsInTableView:(NSTableView*)tableView {
if (GC_FILE_MODE_IS_FILE(delta.oldFile.mode) || GC_FILE_MODE_IS_FILE(delta.newFile.mode)) {
NSString* pathExtension = delta.canonicalPath.pathExtension;
NSString* utType = (__bridge_transfer NSString*)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)pathExtension, kUTTypeData);

if (utType) {
GIDiffFileProvider* provider = [[GIDiffFileProvider alloc] initWithFileType:utType delegate:self];
provider.userInfo = delta;
Expand Down
4 changes: 2 additions & 2 deletions GitUpKit/Core/GCHistory.m
Original file line number Diff line number Diff line change
Expand Up @@ -819,8 +819,8 @@ - (BOOL)_reloadHistory:(GCHistory*)history
XLOG_DEBUG_CHECK(headBranch == nil);
headBranch = (GCHistoryLocalBranch*)referenceObject;
}
int status = gitup_branch_upstream_name(&upstreamName, self.private, git_reference_name(reference));

int status = gitup_branch_upstream_name(&upstreamName, self.private, git_reference_name(reference));
if ((status != GIT_OK) && (status != GIT_ENOTFOUND)) {
LOG_LIBGIT2_ERROR(status); // Don't fail because of corrupted config
}
Expand Down
9 changes: 4 additions & 5 deletions GitUpKit/Core/GCMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static inline void __GCItemListInitialize(GCItemList* list, size_t initialCapaci

#define GC_LIST_CAPACITY(name) name.capacity

#define GC_LIST_ITEM_POINTER(name, index) (name.items + (index)*name.size)
#define GC_LIST_ITEM_POINTER(name, index) (name.items + (index) * name.size)

static inline void __GCItemListAppend(GCItemList* list, const void* itemPointer) {
if (list->count == list->capacity) {
Expand Down Expand Up @@ -178,14 +178,13 @@ static inline BOOL __GCPointerListContains(GCPointerList* list, void* pointer) {
#define GC_POINTER_LIST_CONTAINS(name, pointer) __GCPointerListContains(&name, pointer)

#define GC_POINTER_LIST_FOR_LOOP_NO_BRIDGE(name, type, variable) \
type variable = (type)GC_POINTER_LIST_GET(name, 0); \
type variable = (type)GC_POINTER_LIST_GET(name, 0); \
for (size_t __##variable = 0; (__##variable < name.count) && (variable = (type)GC_POINTER_LIST_GET(name, __##variable), 1); ++__##variable)

#define GC_POINTER_LIST_FOR_LOOP(name, type, variable) \
type variable = (__bridge type)GC_POINTER_LIST_GET(name, 0); \
#define GC_POINTER_LIST_FOR_LOOP(name, type, variable) \
type variable = (__bridge type)GC_POINTER_LIST_GET(name, 0); \
for (size_t __##variable = 0; (__##variable < name.count) && (variable = (__bridge type)GC_POINTER_LIST_GET(name, __##variable), 1); ++__##variable)


#define GC_POINTER_LIST_REVERSE_FOR_LOOP(name, type, variable) \
type variable = name.count ? GC_POINTER_LIST_GET(name, name.count - 1) : NULL; \
for (ssize_t __##variable = name.count - 1; (__##variable >= 0) && (variable = GC_POINTER_LIST_GET(name, __##variable), 1); --__##variable)
Expand Down
2 changes: 1 addition & 1 deletion GitUpKit/Core/GCReflogMessages.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@
#define kGCReflogMessageFormat_GitUp_SetTip @kGCReflogCustomPrefix @"set tip"
#define kGCReflogMessageFormat_GitUp_MoveTip @kGCReflogCustomPrefix @"move tip"

//#define kGCReflogMessageFormat_GitUp_HardReset @kGCReflogCustomPrefix @"hard reset for '%@'"
// #define kGCReflogMessageFormat_GitUp_HardReset @kGCReflogCustomPrefix @"hard reset for '%@'"
#define kGCReflogMessageFormat_GitUp_Undo @kGCReflogCustomPrefix @"undo '%@'"
#define kGCReflogMessageFormat_GitUp_Redo @kGCReflogCustomPrefix @"redo '%@'"
10 changes: 5 additions & 5 deletions GitUpKit/Core/GCRemote.m
Original file line number Diff line number Diff line change
Expand Up @@ -634,11 +634,11 @@ - (GCRemote*)lookupRemoteForRemoteBranch:(GCRemoteBranch*)branch sourceBranchNam
- (BOOL)cloneUsingRemote:(GCRemote*)remote recursive:(BOOL)recursive error:(NSError**)error {
[self willStartRemoteTransferWithURL:remote.URL];

// git_fetch_options fetchOptions = GIT_FETCH_OPTIONS_INIT;
// [self setRemoteCallbacks:&fetchOptions.callbacks];
// git_checkout_options checkoutOptions = GIT_CHECKOUT_OPTIONS_INIT;
// checkoutOptions.checkout_strategy = GIT_CHECKOUT_SAFE;
// git_fetch_options fetchOptions = GIT_FETCH_OPTIONS_INIT;
// [self setRemoteCallbacks:&fetchOptions.callbacks];
// git_checkout_options checkoutOptions = GIT_CHECKOUT_OPTIONS_INIT;
// checkoutOptions.checkout_strategy = GIT_CHECKOUT_SAFE;

git_fetch_options fetchOptions = GIT_FETCH_OPTIONS_INIT;
[self setRemoteCallbacks:&fetchOptions.callbacks];
git_checkout_options checkoutOptions = GIT_CHECKOUT_OPTIONS_INIT;
Expand Down
2 changes: 1 addition & 1 deletion GitUpKit/Core/GCRepository+Config-Tests.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ - (void)testConfig {

NSArray* config2 = [self.repository readAllConfigs:NULL];
XCTAssertEqual(config2.count, 8);
NSUInteger index = [config2 indexOfObjectPassingTest:^BOOL(GCConfigOption *obj, NSUInteger idx, BOOL *stop) {
NSUInteger index = [config2 indexOfObjectPassingTest:^BOOL(GCConfigOption* obj, NSUInteger idx, BOOL* stop) {
return [obj.variable isEqualToString:@"core.repositoryformatversion"];
}];
option = config2[index];
Expand Down
2 changes: 1 addition & 1 deletion GitUpKit/Extensions/GCRepository+Utilities-Tests.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ - (void)testUtilities {
XCTAssertEqualObjects([self.repository hostingURLForProject:&service error:NULL], [NSURL URLWithString:@"https://github.com/git-up/GitUp-Mac"]);
XCTAssertEqual(service, kGCHostingService_GitHub);

XCTAssertTrue([self.repository writeConfigOptionForLevel:kGCConfigLevel_Local variable:@"remote.origin.url" withValue:@"ssh://[email protected]:gitup/test.git" error:NULL]);
XCTAssertTrue([self.repository writeConfigOptionForLevel:kGCConfigLevel_Local variable:@"remote.origin.url" withValue:@"[email protected]:gitup/test.git" error:NULL]);
XCTAssertEqualObjects([self.repository hostingURLForProject:&service error:NULL], [NSURL URLWithString:@"https://bitbucket.org/gitup/test"]);
XCTAssertEqual(service, kGCHostingService_BitBucket);
XCTAssertTrue([self.repository writeConfigOptionForLevel:kGCConfigLevel_Local variable:@"remote.origin.url" withValue:@"https://[email protected]/gitup/test.git" error:NULL]);
Expand Down
14 changes: 13 additions & 1 deletion GitUpKit/GitUpKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand All @@ -13,6 +13,9 @@
0AC8525A23A122C400479160 /* GILaunchServicesLocator.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AC8525823A122C400479160 /* GILaunchServicesLocator.m */; };
1D615D81286BEDC600FFF7E7 /* XLFacilityMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D615D7E286BE79200FFF7E7 /* XLFacilityMacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
1D615D82286BEDCE00FFF7E7 /* XLFacilityMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D615D7E286BE79200FFF7E7 /* XLFacilityMacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
1D841F782B955C3800E4FCCC /* GIRemappingExplanationPopover.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D841F752B955C3800E4FCCC /* GIRemappingExplanationPopover.h */; };
1D841F792B955C3800E4FCCC /* GIRemappingExplanationPopover.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D841F762B955C3800E4FCCC /* GIRemappingExplanationPopover.m */; };
1D841F7A2B955C3800E4FCCC /* GIRemappingExplanationViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1D841F772B955C3800E4FCCC /* GIRemappingExplanationViewController.xib */; };
1DADC0DA25A25D54008C2C35 /* libsqlite3.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBBEE637256B08D300F96DAF /* libsqlite3.xcframework */; };
1DADC0DE25A25D5D008C2C35 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = DBBEE654256B095000F96DAF /* libiconv.tbd */; };
1DADC0E225A25D63008C2C35 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = DBBEE64C256B094000F96DAF /* libz.tbd */; };
Expand Down Expand Up @@ -347,6 +350,9 @@
0AC8525823A122C400479160 /* GILaunchServicesLocator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GILaunchServicesLocator.m; sourceTree = "<group>"; };
0AD01C0B26D6A11C0068A02E /* Third-Party */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "Third-Party"; sourceTree = "<group>"; };
1D615D7E286BE79200FFF7E7 /* XLFacilityMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XLFacilityMacros.h; sourceTree = "<group>"; };
1D841F752B955C3800E4FCCC /* GIRemappingExplanationPopover.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GIRemappingExplanationPopover.h; sourceTree = "<group>"; };
1D841F762B955C3800E4FCCC /* GIRemappingExplanationPopover.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GIRemappingExplanationPopover.m; sourceTree = "<group>"; };
1D841F772B955C3800E4FCCC /* GIRemappingExplanationViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GIRemappingExplanationViewController.xib; sourceTree = "<group>"; };
1DF371CB22F5262300EF7BD9 /* GCLiveRepository+Utilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "GCLiveRepository+Utilities.h"; sourceTree = "<group>"; };
1DF371CC22F5262300EF7BD9 /* GCLiveRepository+Utilities.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "GCLiveRepository+Utilities.m"; sourceTree = "<group>"; };
6D8E3F0A25D90E1300AAFC17 /* GIImageDiffView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GIImageDiffView.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -703,6 +709,9 @@
E22942031AC11F56000A83AF /* GIQuickViewController.h */,
E22942041AC11F56000A83AF /* GIQuickViewController.m */,
E22941F11AC11F56000A83AF /* GIQuickViewController.xib */,
1D841F752B955C3800E4FCCC /* GIRemappingExplanationPopover.h */,
1D841F762B955C3800E4FCCC /* GIRemappingExplanationPopover.m */,
1D841F772B955C3800E4FCCC /* GIRemappingExplanationViewController.xib */,
E22942051AC11F56000A83AF /* GISimpleCommitViewController.h */,
E22942061AC11F56000A83AF /* GISimpleCommitViewController.m */,
E22941F31AC11F56000A83AF /* GISimpleCommitViewController.xib */,
Expand Down Expand Up @@ -966,6 +975,7 @@
E267E1BA1B84D80500BAB377 /* GCBranch.h in Headers */,
E267E1BB1B84D80500BAB377 /* GCCommit.h in Headers */,
E267E1BC1B84D80500BAB377 /* GCCommitDatabase.h in Headers */,
1D841F782B955C3800E4FCCC /* GIRemappingExplanationPopover.h in Headers */,
E267E1BD1B84D80500BAB377 /* GCCore.h in Headers */,
E267E1BE1B84D80500BAB377 /* GCDiff.h in Headers */,
E267E2A61B84F02A00BAB377 /* GCError.h in Headers */,
Expand Down Expand Up @@ -1151,6 +1161,7 @@
E267E2201B84DBD600BAB377 /* Utilities.xcassets in Resources */,
DBDFBC0C22B610F1003EEC6C /* Interface.xcassets in Resources */,
E267E2211B84DBD900BAB377 /* GIWindowController.xib in Resources */,
1D841F7A2B955C3800E4FCCC /* GIRemappingExplanationViewController.xib in Resources */,
E267E23B1B84DC4B00BAB377 /* Components.xcassets in Resources */,
E267E23C1B84DC4B00BAB377 /* Reasons.strings in Resources */,
E267E23D1B84DC4B00BAB377 /* GICommitListViewController.xib in Resources */,
Expand Down Expand Up @@ -1311,6 +1322,7 @@
E267E22E1B84DBF800BAB377 /* GIViewController+Utilities.m in Sources */,
E267E22F1B84DBF800BAB377 /* GIWindowController.m in Sources */,
E267E2311B84DC2600BAB377 /* GICommitListViewController.m in Sources */,
1D841F792B955C3800E4FCCC /* GIRemappingExplanationPopover.m in Sources */,
E267E2321B84DC2600BAB377 /* GIDiffContentsViewController.m in Sources */,
E267E2331B84DC2600BAB377 /* GIDiffFilesViewController.m in Sources */,
1DF371CE22F5262300EF7BD9 /* GCLiveRepository+Utilities.m in Sources */,
Expand Down
6 changes: 1 addition & 5 deletions GitUpKit/Interface/GIFunctions.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ void GIComputeHighlightRanges(const char* deletedBytes, NSUInteger deletedCount,
} else if (TEST_BITS(byte, 0b11111100)) {
remaining = 6;
} else {
do {
// NSCAssert(NO, @"Unreachable code executed in '%s': %s:%i", __FUNCTION__, __FILE__, (int)__LINE__);
// NSAssert(NO, );
} while (0);
// XLOG_DEBUG_CHECK(!(byte & (1 << 7)));
XLOG_DEBUG_CHECK(!(byte & (1 << 7)));
remaining = 1;
}
}
Expand Down
32 changes: 16 additions & 16 deletions GitUpKit/Interface/GIGraph.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

@implementation GIGraph {
GINode* __unsafe_unretained* _mapping;
NSMutableArray *_branches;
NSMutableArray *_layers;
NSMutableArray *_lines;
NSMutableArray *_nodes;
NSMutableArray *_nodesWithReferences;
NSMutableArray* _branches;
NSMutableArray* _layers;
NSMutableArray* _lines;
NSMutableArray* _nodes;
NSMutableArray* _nodesWithReferences;
}

- (instancetype)initWithHistory:(GCHistory*)history options:(GIGraphOptions)options {
Expand All @@ -43,7 +43,7 @@ - (instancetype)initWithHistory:(GCHistory*)history options:(GIGraphOptions)opti
_lines = [NSMutableArray array];
_nodes = [NSMutableArray array];
_nodesWithReferences = [NSMutableArray array];
_mapping = (GINode *__unsafe_unretained*)calloc(_history.nextAutoIncrementID, sizeof(GINode*));
_mapping = (GINode * __unsafe_unretained*)calloc(_history.nextAutoIncrementID, sizeof(GINode*));

[self _generateGraph];
#if DEBUG
Expand Down Expand Up @@ -128,7 +128,7 @@ - (void)_generateGraph {
if ((commit.timeIntervalSinceReferenceDate < staleTime) && ![headCommit isEqualToCommit:commit]) {
[tips removeObject:commit];
if (commit.leaf && !COMMIT_SKIPPED(commit)) {
GC_POINTER_LIST_APPEND(skipList, (__bridge void *)(commit));
GC_POINTER_LIST_APPEND(skipList, (__bridge void*)(commit));
COMMIT_SKIPPED(commit) = YES;
}
}
Expand All @@ -138,7 +138,7 @@ - (void)_generateGraph {
if ((commit.timeIntervalSinceReferenceDate < staleTime) && ![headCommit isEqualToCommit:commit]) {
[tips removeObject:commit];
if (commit.leaf && !COMMIT_SKIPPED(commit)) {
GC_POINTER_LIST_APPEND(skipList, (__bridge void *)(commit));
GC_POINTER_LIST_APPEND(skipList, (__bridge void*)(commit));
COMMIT_SKIPPED(commit) = YES;
}
}
Expand All @@ -153,7 +153,7 @@ - (void)_generateGraph {
if (!commit.remoteBranches || (_options & kGIGraphOption_SkipStandaloneRemoteBranchTips)) {
[tips removeObject:commit];
if (!COMMIT_SKIPPED(commit)) {
GC_POINTER_LIST_APPEND(skipList, (__bridge void *)(commit));
GC_POINTER_LIST_APPEND(skipList, (__bridge void*)(commit));
COMMIT_SKIPPED(commit) = YES;
}
}
Expand All @@ -170,7 +170,7 @@ - (void)_generateGraph {
if (!(_options & kGIGraphOption_PreserveUpstreamRemoteBranchTips) || ![upstreamTips containsObject:commit]) {
[tips removeObject:commit];
if (commit.leaf && !COMMIT_SKIPPED(commit)) {
GC_POINTER_LIST_APPEND(skipList, (__bridge void *)(commit));
GC_POINTER_LIST_APPEND(skipList, (__bridge void*)(commit));
COMMIT_SKIPPED(commit) = YES;
}
}
Expand Down Expand Up @@ -244,8 +244,8 @@ - (void)_generateGraph {
// Skip commit if applicable
if (skip) {
XLOG_DEBUG_CHECK(!updateTips || ![tips containsObject:parent]);
XLOG_DEBUG_CHECK(!GC_POINTER_LIST_CONTAINS(newSkipList, (__bridge void *)(parent)));
GC_POINTER_LIST_APPEND(newSkipList, (__bridge void *)(parent));
XLOG_DEBUG_CHECK(!GC_POINTER_LIST_CONTAINS(newSkipList, (__bridge void*)(parent)));
GC_POINTER_LIST_APPEND(newSkipList, (__bridge void*)(parent));
COMMIT_SKIPPED(parent) = YES;
}
}
Expand Down Expand Up @@ -454,7 +454,7 @@ - (void)_computeNodePositions {
CGFloat maxX = 0.0;
for (CFIndex i = 0, count = self.layers.count; i < count; ++i) {
GILayer* layer = self.layers[i];

CGFloat lastX = 0.0;
NSUInteger index = 0;
for (GINode* node in layer.nodes) {
Expand Down Expand Up @@ -696,7 +696,7 @@ - (void)walkAncestorsOfNode:(GINode*)node

__block CFIndex index = node.layer.index;
CFIndex maxIndex = self.layers.count;
GC_POINTER_LIST_APPEND(row, (__bridge void *)(node));
GC_POINTER_LIST_APPEND(row, (__bridge void*)(node));
while (1) {
++index;
if (index == maxIndex) {
Expand All @@ -714,13 +714,13 @@ - (void)walkAncestorsOfNode:(GINode*)node
for (NSUInteger i = 0, count = previousNode.parentCount; i < count; ++i) {
GINode* parent = [previousNode parentAtIndex:i];
XLOG_DEBUG_CHECK(parent.layer == layer);
if (!GC_POINTER_LIST_CONTAINS( tempRow, (__bridge void *)(parent) )) {
if (!GC_POINTER_LIST_CONTAINS(tempRow, (__bridge void*)(parent))) {
BOOL stop = NO;
nodeBlock(layer, parent, &stop);
if (stop) {
goto cleanup;
}
GC_POINTER_LIST_APPEND( tempRow, (__bridge void *)(parent) );
GC_POINTER_LIST_APPEND(tempRow, (__bridge void*)(parent));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions GitUpKit/Interface/GIGraphView.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@

#define kScrollingInset kSpacingY

#define CONVERT_X(x) (kSpacingX + (x)*kSpacingX)
#define CONVERT_Y(y) (kSpacingY + (y)*kSpacingY)
#define CONVERT_X(x) (kSpacingX + (x) * kSpacingX)
#define CONVERT_Y(y) (kSpacingY + (y) * kSpacingY)
#define SQUARE(x) ((x) * (x))
#define SELECTED_NODE_BOUNDS(x, y) NSMakeRect(x - kSpacingX / 2, y - (kSelectedLabelMaxHeight / 2) - kSelectedBorderWidth, kSelectedLabelMaxWidth + kSpacingX / 2 + 40, kSelectedLabelMaxHeight + (kSelectedBorderWidth * 2))
#define NODE_LABEL_BOUNDS(x, y) NSMakeRect(x - kSpacingX / 2, y - kSpacingY / 2, kNodeLabelMaxWidth + kSpacingX / 2 + 30, kNodeLabelMaxHeight + kSpacingY / 2)
Expand Down
8 changes: 4 additions & 4 deletions GitUpKit/Utilities/NSColor+GINamedColors.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ + (NSArray*)gitUpGraphAlternatingBranchColors {
}

#define IMPLEMENT_NAMED_COLOR(__NAME__, __ASSET__) \
+(NSColor*)gitUp##__NAME__##Color { \
NSBundle* bundle = NSBundle.gitUpKitBundle; \
return [NSColor colorNamed:@__ASSET__ \
bundle:bundle]; \
+(NSColor*)gitUp##__NAME__##Color { \
NSBundle* bundle = NSBundle.gitUpKitBundle; \
return [NSColor colorNamed:@__ASSET__ \
bundle:bundle]; \
}

IMPLEMENT_NAMED_COLOR(Separator, "separator")
Expand Down
10 changes: 9 additions & 1 deletion GitUpKit/Views/GIAdvancedCommitViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#import "GIAdvancedCommitViewController.h"
#import "GIDiffFilesViewController.h"
#import "GIDiffContentsViewController.h"
#import "GIRemappingExplanationPopover.h"
#import "GIViewController+Utilities.h"

#import "GIColorView.h"
Expand Down Expand Up @@ -89,6 +90,13 @@ - (void)viewWillAppear {
_indexFilesViewController.selectedDelta = _indexStatus.deltas.firstObject;
}

- (void)viewDidAppear {
[super viewDidAppear];

// Remove this logic in a year or so
[GIRemappingExplanationPopover showIfNecessaryRelativeToRect:NSZeroRect ofView:_commitButton preferredEdge:NSRectEdgeMinY];
}

- (void)viewDidDisappear {
[super viewDidDisappear];

Expand Down Expand Up @@ -332,7 +340,7 @@ - (BOOL)diffFilesViewController:(GIDiffFilesViewController*)controller handleKey
}
} else if (controller == _indexFilesViewController && !modifiers && event.keyCode == kGIKeyCode_Up) {
bool onlyFirstFileSelected = (controller.selectedDeltas.count == 1) && (controller.selectedDelta == controller.deltas.firstObject);
bool hasWorkdirFiles =_workdirFilesViewController.deltas.count > 0;
bool hasWorkdirFiles = _workdirFilesViewController.deltas.count > 0;
if (onlyFirstFileSelected && hasWorkdirFiles) {
// move focus to previous controller
[[controller.view window] selectPreviousKeyView:_workdirFilesViewController.view];
Expand Down
Loading

0 comments on commit 3f0bcc5

Please sign in to comment.