From 500ddd7f4bf36cdcaa7c0bdf5dae617c36535371 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 4 Jan 2011 17:03:29 -0400 Subject: [PATCH] add a check for unknown UUID when logging --- LocationLog.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/LocationLog.hs b/LocationLog.hs index 6d52f4bdd1..e4dad03f5c 100644 --- a/LocationLog.hs +++ b/LocationLog.hs @@ -32,6 +32,7 @@ import System.Locale import qualified Data.Map as Map import System.Directory import System.Posix.Process +import Control.Monad (when) import qualified GitRepo as Git import Utility @@ -86,6 +87,8 @@ instance Read LogLine where - and returns the filename of the logfile. -} logChange :: Git.Repo -> Key -> UUID -> LogStatus -> IO FilePath logChange repo key u s = do + when (null u) $ + error $ "bug detected: unknown UUID for " ++ Git.repoDescribe repo line <- logNow s u ls <- readLog logfile writeLog logfile (compactLog $ line:ls)