]> git.cworth.org Git - notmuch/blobdiff - notmuch-git.py
CLI/git: make existance of config branch optional on clone
[notmuch] / 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(