summaryrefslogtreecommitdiff
path: root/test.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-01-11 16:00:40 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-01-11 16:00:40 -0400
commita8ce30401dd69d1d203cfc33b791c1b4d175666e (patch)
tree4d8107d878934d8b8a8606365b3d4367dbe4d239 /test.hs
parent3a844b1f3c5eb85d4571857ac10aa8183996513a (diff)
add checks that location log files are committed
currently failing for move --to
Diffstat (limited to 'test.hs')
-rw-r--r--test.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/test.hs b/test.hs
index 20e8bc28a..0a5a365d9 100644
--- a/test.hs
+++ b/test.hs
@@ -375,6 +375,18 @@ checklocationlog f expected = do
uuids <- LocationLog.keyLocations g' k
assertEqual ("location log for " ++ f ++ " " ++ (show k) ++ " " ++ thisuuid)
expected (elem thisuuid uuids)
+
+ -- Location log files should always be checked
+ -- into git, and any modifications staged for
+ -- commit. This is a regression test, as some
+ -- commands forgot to.
+ let lf = LocationLog.logFile g' k
+ fs <- Git.inRepo g' [lf]
+ when (null fs) $
+ assertFailure $ f ++ " logfile not added to git repo"
+ ufs <- Git.changedUnstagedFiles g' [lf]
+ when (not $ null ufs) $
+ assertFailure $ f ++ " logfile changes not staged"
_ -> assertFailure $ f ++ " failed to look up key"
inlocationlog :: FilePath -> Assertion