]> git.notmuchmail.org Git - notmuch/commitdiff
CLI/git: make existance of config branch optional on clone
authorDavid Bremner <david@tethera.net>
Mon, 4 Apr 2022 03:05:36 +0000 (21:05 -0600)
committerDavid Bremner <david@tethera.net>
Fri, 17 Jun 2022 11:40:19 +0000 (08:40 -0300)
This branch is actually only used by an associated
utility (notmuch-report), and notmuch-git works fine without it.

notmuch-git.py

index 34d07125c2facba8a9dc913e1edef87d72fb58ba..0cbfec616e81f9ee2ea78e91ebdd1037d39a4465 100644 (file)
@@ -271,7 +271,13 @@ def clone(repository):
             wait=True)
     _git(args=['config', '--unset', 'core.worktree'], wait=True, expect=(0, 5))
     _git(args=['config', 'core.bare', 'true'], wait=True)
-    _git(args=['branch', 'config', 'origin/config'], wait=True)
+    (status, stdout, stderr) = _git(args=['show-ref', '--verify',
+                                          '--quiet',
+                                          'refs/remotes/origin/config'],
+                                    expect=(0,1),
+                                    wait=True)
+    if status == 0:
+        _git(args=['branch', 'config', 'origin/config'], wait=True)
     existing_tags = get_tags()
     if existing_tags:
         _LOG.warning(