cross-repo import now working correctly
This commit is contained in:
parent
ee251b2e2e
commit
68d1661251
2 changed files with 12 additions and 7 deletions
|
@ -307,12 +307,13 @@ updateContentIdentifierDbFromBranch :: CIDDb.ContentIdentifierHandle -> Annex ()
|
||||||
updateContentIdentifierDbFromBranch db = do
|
updateContentIdentifierDbFromBranch db = do
|
||||||
oldtree <- liftIO $ CIDDb.getAnnexBranchTree db
|
oldtree <- liftIO $ CIDDb.getAnnexBranchTree db
|
||||||
inRepo (Git.Ref.tree Annex.Branch.fullname) >>= \case
|
inRepo (Git.Ref.tree Annex.Branch.fullname) >>= \case
|
||||||
Just t | t /= oldtree -> do
|
Just currtree | currtree /= oldtree -> do
|
||||||
(l, cleanup) <- inRepo $ DiffTree.diffTree oldtree t
|
(l, cleanup) <- inRepo $
|
||||||
|
DiffTree.diffTreeRecursive oldtree currtree
|
||||||
mapM_ go l
|
mapM_ go l
|
||||||
void $ liftIO $ cleanup
|
void $ liftIO $ cleanup
|
||||||
liftIO $ do
|
liftIO $ do
|
||||||
CIDDb.recordAnnexBranchTree db t
|
CIDDb.recordAnnexBranchTree db t currtree
|
||||||
CIDDb.flushDbQueue db
|
CIDDb.flushDbQueue db
|
||||||
_ -> return ()
|
_ -> return ()
|
||||||
where
|
where
|
||||||
|
|
|
@ -17,10 +17,6 @@ this.
|
||||||
* Need to support annex-tracking-branch configuration, which documentation
|
* Need to support annex-tracking-branch configuration, which documentation
|
||||||
says makes git-annex sync and assistant do imports.
|
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.
|
* When on an adjusted unlocked branch, need to import the files unlocked.
|
||||||
Also, the tracking branch code needs to know about such branches,
|
Also, the tracking branch code needs to know about such branches,
|
||||||
currently it will generate the wrong tracking branch.
|
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
|
The test case for `export_import` currently has a line commented out
|
||||||
that fails on adjusted unlocked branches.
|
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,
|
* What if the remote lists importable filenames that are absolute paths,
|
||||||
or contain a "../" attack? Does git already guard against merging such
|
or contain a "../" attack? Does git already guard against merging such
|
||||||
trees?
|
trees?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue