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.
This commit is contained in:
Joey Hess 2011-11-16 18:56:06 -04:00
parent 6d9f525f64
commit 1ffd54ef78

View file

@ -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