diff options
-rw-r--r-- | Annex/WorkTree.hs | 7 | ||||
-rw-r--r-- | Test.hs | 28 | ||||
-rw-r--r-- | doc/todo/smudge.mdwn | 8 |
3 files changed, 25 insertions, 18 deletions
diff --git a/Annex/WorkTree.hs b/Annex/WorkTree.hs index c824e7fc5..85ea9a62e 100644 --- a/Annex/WorkTree.hs +++ b/Annex/WorkTree.hs @@ -13,7 +13,7 @@ import Annex.CatFile import Annex.Version import Config -{- Looks up the key corresponding to an annexed file, +{- Looks up the key corresponding to an annexed file in the work tree, - by examining what the file links to. - - An unlocked file will not have a link on disk, so fall back to @@ -25,7 +25,10 @@ lookupFile file = do case mkey of Just key -> makeret key Nothing -> ifM (versionSupportsUnlockedPointers <||> isDirect) - ( maybe (return Nothing) makeret =<< catKeyFile file + ( ifM (liftIO $ doesFileExist file) + ( maybe (return Nothing) makeret =<< catKeyFile file + , return Nothing + ) , return Nothing ) where @@ -123,8 +123,8 @@ tests = testGroup "Tests" $ properties : map (\(d, te) -> withTestMode te (unitTests d)) testmodes where testmodes = - --[ ("v6", TestMode { forceDirect = False, annexVersion = "6" }) - [ ("v5", TestMode { forceDirect = False, annexVersion = "5" }) + [ ("v6", TestMode { forceDirect = False, annexVersion = "6" }) + , ("v5", TestMode { forceDirect = False, annexVersion = "5" }) -- Windows will only use direct mode, so don't test twice. #ifndef mingw32_HOST_OS , ("v5 direct", TestMode { forceDirect = True, annexVersion = "5" }) @@ -770,6 +770,7 @@ test_migrate' usegitattributes = intmpclonerepoInDirect $ do test_unused :: Assertion -- This test is broken in direct mode test_unused = intmpclonerepoInDirect $ do + checkunused [] "in new clone" -- keys have to be looked up before files are removed annexedfilekey <- annexeval $ findkey annexedfile sha1annexedfilekey <- annexeval $ findkey sha1annexedfile @@ -797,8 +798,8 @@ test_unused = intmpclonerepoInDirect $ do checkunused [] "after dropunused" not <$> git_annex "dropunused" ["--force", "10", "501"] @? "dropunused failed to fail on bogus numbers" - -- unused used to miss symlinks that were not staged and pointed - -- at annexed content, and think that content was unused + -- unused used to miss renamed symlinks that were not staged + -- and pointed at annexed content, and think that content was unused writeFile "unusedfile" "unusedcontent" git_annex "add" ["unusedfile"] @? "add of unusedfile failed" unusedfilekey <- annexeval $ findkey "unusedfile" @@ -806,7 +807,7 @@ test_unused = intmpclonerepoInDirect $ do boolSystem "git" [Param "rm", Param "-qf", File "unusedfile"] @? "git rm failed" checkunused [] "with unstaged link" removeFile "unusedunstagedfile" - checkunused [unusedfilekey] "with unstaged link deleted" + checkunused [unusedfilekey] "with renamed link deleted" -- unused used to miss symlinks that were deleted or modified -- manually, but commited as such. @@ -1096,6 +1097,11 @@ test_nonannexed_file_conflict_resolution = do indir r2 $ do disconnectOrigin writeFile conflictor nonannexed_content + boolSystem "git" + [ Param "config" + , Param "annex.largefiles" + , Param ("exclude=" ++ ingitfile ++ " and exclude=" ++ conflictor) + ] @? "git config annex.largefiles failed" boolSystem "git" [Param "add", File conflictor] @? "git add conflictor failed" git_annex "sync" [] @? "sync failed in r2" pair r1 r2 @@ -1629,6 +1635,12 @@ configrepo dir = indir dir $ do boolSystem "git" [Param "config", Param "user.email", Param "test@example.com"] @? "git config failed" -- avoid signed commits by test suite boolSystem "git" [Param "config", Param "commit.gpgsign", Param "false"] @? "git config failed" + -- tell git-annex to not annex the ingitfile + boolSystem "git" + [ Param "config" + , Param "annex.largefiles" + , Param ("exclude=" ++ ingitfile) + ] @? "git config annex.largefiles failed" ensuretmpdir :: IO () ensuretmpdir = do @@ -1797,12 +1809,6 @@ setupTestMode = do testmode <- getTestMode when (forceDirect testmode) $ git_annex "direct" ["-q"] @? "git annex direct failed" - whenM (annexeval Annex.Version.versionSupportsUnlockedPointers) $ - boolSystem "git" - [ Param "config" - , Param "annex.largefiles" - , Param ("exclude=" ++ ingitfile) - ] @? "git config annex.largefiles failed" changeToTmpDir :: FilePath -> IO () changeToTmpDir t = do diff --git a/doc/todo/smudge.mdwn b/doc/todo/smudge.mdwn index 0d2f30e07..34a73740d 100644 --- a/doc/todo/smudge.mdwn +++ b/doc/todo/smudge.mdwn @@ -3,11 +3,9 @@ git-annex should use smudge/clean filters. ### implementation todo list * Test suite: - Next "needs to be done" is to work on the test suite some more for v6 - repositories. Need to add a test for how it resolves a conflict between - an unlocked and a locked file that point to the same key. Need to add - another pass through all the tests with files being unlocked. And need to - fix the two remaining test failures. + - add a test for how it resolves a conflict between + an unlocked and a locked file that point to the same key. + - add another pass through all the tests with files being unlocked in v6 mode * Reconcile staged changes into the associated files database, whenever the database is queried. This is needed to handle eg: git add largefile |