diff --git a/Annex/Import.hs b/Annex/Import.hs index 2630d12d85..712e125c5e 100644 --- a/Annex/Import.hs +++ b/Annex/Import.hs @@ -307,12 +307,13 @@ updateContentIdentifierDbFromBranch :: CIDDb.ContentIdentifierHandle -> Annex () updateContentIdentifierDbFromBranch db = do oldtree <- liftIO $ CIDDb.getAnnexBranchTree db inRepo (Git.Ref.tree Annex.Branch.fullname) >>= \case - Just t | t /= oldtree -> do - (l, cleanup) <- inRepo $ DiffTree.diffTree oldtree t + Just currtree | currtree /= oldtree -> do + (l, cleanup) <- inRepo $ + DiffTree.diffTreeRecursive oldtree currtree mapM_ go l void $ liftIO $ cleanup liftIO $ do - CIDDb.recordAnnexBranchTree db t + CIDDb.recordAnnexBranchTree db t currtree CIDDb.flushDbQueue db _ -> return () where diff --git a/doc/todo/import_tree.mdwn b/doc/todo/import_tree.mdwn index 52fe4e4935..d786e3d929 100644 --- a/doc/todo/import_tree.mdwn +++ b/doc/todo/import_tree.mdwn @@ -17,10 +17,6 @@ this. * Need to support annex-tracking-branch configuration, which documentation says makes git-annex sync and assistant do imports. -* Test behavior when multiple repos import from same special remote; - the second importer should not re-download as long as it has pulled - from the first importer. - * When on an adjusted unlocked branch, need to import the files unlocked. Also, the tracking branch code needs to know about such branches, currently it will generate the wrong tracking branch. @@ -28,6 +24,14 @@ this. The test case for `export_import` currently has a line commented out that fails on adjusted unlocked branches. + Alternatively, could not do anything special for adjusted branches, + so generating a non-adjusted branch, and require the user use `git annex + sync` to merge in that branch. Rationalle: After fetching from a normal + git repo in an adjusted branch, merging does the same thing, and the docs + say to use `git annex sync` instead. Any improvments to that workflow + (like eg a way to merge a specified branch and update the adjustment) + would thus benefit both uses cases. + * What if the remote lists importable filenames that are absolute paths, or contain a "../" attack? Does git already guard against merging such trees?