[PATCH] nmbug: mark repository as bare on clone

Subject: [PATCH] nmbug: mark repository as bare on clone

Date: Sat, 12 Apr 2014 13:30:32 -0300

To: notmuch@notmuchmail.org

Cc:

From: David Bremner


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


Thread: