From 33f23c80d100f3d854105df2d9dde21ff80da554 Mon Sep 17 00:00:00 2001 From: Julien Rebetez Date: Thu, 15 Sep 2011 15:12:21 +0200 Subject: [PATCH 1/1] Patch to correctly handle fake bare repositories with core.bare not set MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --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 --- lib/git-fake-bare | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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="$@" -- 2.39.5