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 | |
parent | ed91fe6a1c32fa52abfae46d35fcb50b9f8c63c8 (diff) |
Fix crash when entering/changing view in a subdirectory of a repo that has a dotfile in its root.
-rw-r--r-- | Annex/View.hs | 12 | ||||
-rw-r--r-- | debian/changelog | 2 |
2 files changed, 9 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) diff --git a/debian/changelog b/debian/changelog index e60b43aa5..1b9e27dfa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,8 @@ git-annex (6.20160512) UNRELEASED; urgency=medium is in a nonstandard place. * Work around git bug in handling of relative path to GIT_INDEX_FILE when in a subdirectory of the repository. This affected git annex view. + * Fix crash when entering/changing view in a subdirectory of a repo that + has a dotfile in its root. -- Joey Hess <id@joeyh.name> Wed, 11 May 2016 16:08:38 -0400 |