pedroborges / kirby-autogit

⬢ Saves every change made via Kirby Panel to a Git repository
149 stars 23 forks source link

"remote get-url" unavailable on git < 2.7 #16

Closed Jasper2-0 closed 7 years ago

Jasper2-0 commented 7 years ago

Working on a project on a shared host, where I don't have control over which git version I'm running, I came across the following problem, the hasRemote() function will return false if the remote get-url command is unavailable. I patched it by rewriting it as such (tested on Git 1.7.1)

    public function hasRemote($remoteName = null)
    {
        $remoteName = $remoteName ? $remoteName : $this->remoteName;

        try {
            $this->execute("config --get remote.origin.url");
        } catch (Exception $e) {
            return false;
        }

        return true;
    }
pedroborges commented 7 years ago

That's a known issue and next version of Auto Git will make use if the same command you used to fix it.

thomasjonas commented 7 years ago

When will this new version come out? We're also having this issue...

woudsma commented 7 years ago

+1