Question

Context:

I have a Mac app. I want to include Git in this app because some functions of my app use Git and I don't want the user to have to install it on his machine.

I have downloaded Git from source. I edited the Makefile to declare these two lines:

NO_GETTEXT="yesPlease"
CURLDIR=/usr/local

The first line tells the build process to skip localizing and just use English. The second line declares the path to where libcurl is installed. I downloaded libcurl_devel and built it from source. This is required to enable Git to pull/push from http and https repos.

Git builds successfully. I then copy all of the resulting files into my app's bundle. I'm using NSTask to run Git and attempt to pull an https://-based repo.

The Problem:

The error I get is:

fatal: Unable to find remote helper for 'https'

I googled this, and everyone said that as long as I had libcurl installed when I built Git, Git would work with HTTP and HTTPS addresses. And, in fact, if I run the installed Git from the command line, it does!

What I Need:

So, I must be missing a path setting or an environment variable or SOMETHING that tells Git where to find those remote helpers. They ARE in my app bundle; the screenshot below shows them:

enter image description here

So: what the hell do I need to set in order to resolve this problem when I run Git from within my application bundle?

Was it helpful?

Solution

Unbelievable. I've been trying to fix this for 8+ hours and five minutes after I finally break down and post this question, I figure it out:

Git has an option called --exec-path. I had been passing this argument to the NSTask like this (Where APP BUNDLE is replaced by the path to the application bundle on the user's machine):

--exec-path=[APP BUNDLE]/git/bin

Since bin was the folder where the Git binary was located, I figured that was the appropriate path. However, if I do this:

--exec-path=[APP BUNDLE]/git/libexec/git-core

It works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top