From: Julien Rebetez Date: Thu, 15 Sep 2011 13:12:21 +0000 (+0200) Subject: Patch to correctly handle fake bare repositories with core.bare not set X-Git-Url: https://git.madduck.net/code/myrepos.git/commitdiff_plain/33f23c80d100f3d854105df2d9dde21ff80da554 Patch to correctly handle fake bare repositories with core.bare not set --20cf300513b2820cbe04acfaa084 Content-Type: text/plain; charset=ISO-8859-1 Hello, First, thanks for writing mr, I love it ! I was trying to setup mr to handle a detached worktree git repository and found out it was unable to determine the repository type. It turned out my config only had "core.worktree=../../" set but no "core.bare" and therefore, 'git_fake_bare_test' was unable to determine it's a detached worktree dir. So the attached patch fix this problem by checking for core.worktree instead of core.bare in the config file. Best regards, Julien Hello,
First, thanks for writing mr, I love it !

I was trying to setup mr to handle a detached worktree git repository and found out it was unable to determine the repository type. 
It turned out my config only had "core.worktree=../../" set but no "core.bare" and therefore, 'git_fake_bare_test' was unable to determine
it's a detached worktree dir.

So the attached patch fix this problem by checking for core.worktree instead of core.bare in the config file.

Best regards,
Julien
From b1c62a06c6c3668c52dd90014325d0c831a45ae7 Mon Sep 17 00:00:00 2001 From: Julien Rebetez Date: Thu, 15 Sep 2011 14:59:47 +0200 Subject: [PATCH] Modify git_fake_bare_test to check core.worktree instead of core.bare to determine if a given repository is a detached worktree ('fake bar'). This allow mr to correctly handle the case where core.bare is missing from the config file (implicitely false) and only core.worktree is set. Signed-off-by: Julien Rebetez --- diff --git a/lib/git-fake-bare b/lib/git-fake-bare index aec9b66..398478e 100644 --- a/lib/git-fake-bare +++ b/lib/git-fake-bare @@ -45,7 +45,7 @@ lib = git_fake_bare_test = test -d "$MR_REPO"/refs/heads && test -d "$MR_REPO"/refs/tags && test -d "$MR_REPO"/objects && test -f "$MR_REPO"/config && - test "$(GIT_DIR="$MR_REPO" git config --get core.bare)" = false + test `GIT_DIR="$MR_REPO" git config --get core.worktree` git_fake_bare_update = args="$@"