diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-05-17 13:49:10 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-05-17 13:49:10 -0400 |
commit | 7981e6bb960be49414a752bad519287d007a6f76 (patch) | |
tree | 93b267fd936ff2d5f4c339ec0d4a0a0b15b5ce5b /Annex | |
parent | ed91fe6a1c32fa52abfae46d35fcb50b9f8c63c8 (diff) |
Fix crash when entering/changing view in a subdirectory of a repo that has a dotfile in its root.
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/View.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Annex/View.hs b/Annex/View.hs index 3f8f8ad17..7d2b43e60 100644 --- a/Annex/View.hs +++ b/Annex/View.hs @@ -341,22 +341,24 @@ applyView' mkviewedfile getfilemetadata view = do liftIO . nukeFile =<< fromRepo gitAnnexViewIndex uh <- withViewIndex $ inRepo Git.UpdateIndex.startUpdateIndex forM_ l $ \f -> do - relf <- getTopFilePath <$> inRepo (toTopFilePath f) - go uh relf =<< lookupFile f + topf <- inRepo (toTopFilePath f) + go uh topf =<< lookupFile f liftIO $ do void $ stopUpdateIndex uh void clean genViewBranch view where genviewedfiles = viewedFiles view mkviewedfile -- enables memoization - go uh f (Just k) = do + go uh topf (Just k) = do metadata <- getCurrentMetaData k + let f = getTopFilePath topf let metadata' = getfilemetadata f `unionMetaData` metadata forM_ (genviewedfiles f metadata') $ \fv -> do f' <- fromRepo $ fromTopFilePath $ asTopFilePath fv stagesymlink uh f' =<< calcRepo (gitAnnexLink f' k) - go uh f Nothing - | "." `isPrefixOf` f = do + go uh topf Nothing + | "." `isPrefixOf` getTopFilePath topf = do + f <- fromRepo $ fromTopFilePath topf s <- liftIO $ getSymbolicLinkStatus f if isSymbolicLink s then stagesymlink uh f =<< liftIO (readSymbolicLink f) |