diff options
author | Joey Hess <joey@kitenet.net> | 2011-11-16 18:56:06 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-11-16 18:56:06 -0400 |
commit | 1ffd54ef781b0c240d7de6c80cfcb01328efc25f (patch) | |
tree | 14eb36842f24bc9d83fc6c92a9acfe15561d788b | |
parent | 6d9f525f647fb24f4955e4a51156741f216d3931 (diff) |
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.
-rw-r--r-- | Annex/Branch.hs | 2 |
1 files changed, 2 insertions, 0 deletions
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 |