Skip to content

Commit

Permalink
Add MacGPG2 to PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
OdNairy committed Jul 3, 2020
1 parent 001b4fc commit 8e68e07
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions GitUp/Application/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ - (void)applicationDidFinishLaunching:(NSNotification*)notification {
// Locate installed apps.
[GILaunchServicesLocator setup];

setenv("PATH", strcat(getenv("PATH"), ":/usr/local/MacGPG2/bin"), 1);

// Initialize user notification center
[[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:self];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<EnvironmentVariable
key = "PATH"
value = "PATH=${PATH}:/usr/local/MacGPG2/bin"
isEnabled = "YES">
isEnabled = "NO">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
Expand Down
6 changes: 5 additions & 1 deletion GitUpKit/Core/GCRepository+Bare.m
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,15 @@ - (GCCommit*)createCommitFromTree:(git_tree*)tree
CALL_LIBGIT2_FUNCTION_GOTO(cleanup, git_signature_default, &signature, self.private);

git_buf commitBuffer = GIT_BUF_INIT_CONST("", 0);
const char *gpgSignature = NULL;
if ([shouldSignOption.value isEqualToString:@"true"]) {
GCConfigOption* signingKeyOption = [self readConfigOptionForVariable:@"user.signingkey" error:nil];

CALL_LIBGIT2_FUNCTION_GOTO(cleanupBuffer, git_commit_create_buffer, &commitBuffer, self.private, author ? author : signature, signature, NULL, GCCleanedUpCommitMessage(message).bytes, tree, count, parents);
const char *gpgSignature = [self gpgSig:commitBuffer.ptr keyId:signingKeyOption.value];
gpgSignature = [self gpgSig:commitBuffer.ptr keyId:signingKeyOption.value];
}

if (gpgSignature != NULL) {
CALL_LIBGIT2_FUNCTION_GOTO(cleanupBuffer, git_commit_create_with_signature, &oid, self.private, commitBuffer.ptr, gpgSignature, NULL);
} else {
CALL_LIBGIT2_FUNCTION_GOTO(cleanupBuffer, git_commit_create, &oid, self.private, NULL, author ? author : signature, signature, NULL, GCCleanedUpCommitMessage(message).bytes, tree, count, parents);
Expand Down

0 comments on commit 8e68e07

Please sign in to comment.