[PATCH] nmbug: mark repository as bare on clone

David Bremner david at tethera.net
Sat Apr 12 09:30:32 PDT 2014


As far as I can figure out, if a git repository is non-bare, then it
should either have core.worktree set, or the parent directory should
be the worktree. Since the parent directory is usually the user's home
directory, we don't want that. Although unlikely to be typed by
mistake

% cd $HOME && ln -s .nmbug .git && git reset --hard

would delete a bunch of files.
---

Hah, I managed to escalate a documentation quibble into a
sortof-security issue.

 devel/nmbug/nmbug | 1 +
 1 file changed, 1 insertion(+)

diff --git a/devel/nmbug/nmbug b/devel/nmbug/nmbug
index d6f5213..b18ded7 100755
--- a/devel/nmbug/nmbug
+++ b/devel/nmbug/nmbug
@@ -134,6 +134,7 @@ sub do_clone {
           $repository, $tempwork) == 0
     or die "'git clone' exited with nonzero value\n";
   git ('config', '--unset', 'core.worktree');
+  git ('config', 'core.bare', 'true');
 }
 
 sub is_committed {
-- 
1.9.1



More information about the notmuch mailing list