From 1ffd54ef781b0c240d7de6c80cfcb01328efc25f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 16 Nov 2011 18:56:06 -0400 Subject: ensure branch exists before trying to update it The branch may not exist, if .git/annex has been copied over from another repo (or a corrupted repo). I suppose it could also have gotten deleted somehow. Without this, there is a confusing failure. --- Annex/Branch.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Annex') diff --git a/Annex/Branch.hs b/Annex/Branch.hs index a62a1384c..ccc614555 100644 --- a/Annex/Branch.hs +++ b/Annex/Branch.hs @@ -130,6 +130,8 @@ commit message = whenM journalDirty $ lockJournal $ do -} update :: Annex () update = onceonly $ do + -- ensure branch exists + create -- check what needs updating before taking the lock dirty <- journalDirty c <- filterM (changedBranch name . snd) =<< siblingBranches -- cgit v1.2.3