summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-03-03 21:34:30 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-03-03 21:34:30 -0400
commitbc2df77642490be830cde9a46428d25051120893 (patch)
treec4bf319c1f640f5dcdf11d1c1fc16e0242c61a3e
parent14e0d01b58c504e889b636e952e165f3cf8ab6c9 (diff)
Bugfix: When fsck detected and moved away corrupt file content, it did not update the location log.
-rw-r--r--Content.hs1
-rw-r--r--debian/changelog2
-rw-r--r--test.hs3
3 files changed, 5 insertions, 1 deletions
diff --git a/Content.hs b/Content.hs
index 6b8316c08..bcd4ac0e1 100644
--- a/Content.hs
+++ b/Content.hs
@@ -147,6 +147,7 @@ moveBad key = do
liftIO $ allowWrite (parentDir src)
liftIO $ renameFile src dest
liftIO $ removeDirectory (parentDir src)
+ logStatus key ValueMissing
return dest
{- List of keys whose content exists in .git/annex/objects/ -}
diff --git a/debian/changelog b/debian/changelog
index a854235ce..ab9aa3a27 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,6 +19,8 @@ git-annex (0.22) UNRELEASED; urgency=low
* Look for dir.git directories the same as git does.
* Support remote urls specified as relative paths.
* Support non-ssh remote paths that contain tilde expansions.
+ * Bugfix: When fsck detected and moved away corrupt file content, it did
+ not update the location log.
-- Joey Hess <joeyh@debian.org> Sun, 13 Feb 2011 00:48:02 -0400
diff --git a/test.hs b/test.hs
index 936e4da17..31960bb2e 100644
--- a/test.hs
+++ b/test.hs
@@ -367,13 +367,14 @@ test_fsck = "git-annex fsck" ~: TestList [basicfsck, withlocaluntrusted, withrem
git_annex "fsck" ["-q"] @? "fsck failed with numcopies=2 and 2 copies"
git_annex "untrust" ["-q", "origin"] @? "untrust of origin failed"
fsck_should_fail "content not replicated to enough non-untrusted repositories"
+
corrupt f = do
git_annex "get" ["-q", f] @? "get of file failed"
Content.allowWrite f
writeFile f (changedcontent f)
r <- git_annex "fsck" ["-q"]
not r @? "fsck failed to fail with corrupted file content"
- git_annex "fsck" ["-q"] @? "fsck unexpectedly failed again; previous one did not fix problem"
+ git_annex "fsck" ["-q"] @? "fsck unexpectedly failed again; previous one did not fix problem with " ++ f
fsck_should_fail m = do
r <- git_annex "fsck" ["-q"]
not r @? "fsck failed to fail with " ++ m