fix sync --content with remote.name.annex-tracking-branch=master:subdir

It was exporting the whole tree not just the subdir. Now tested fully
working in both directions.
This commit is contained in:
Joey Hess 2019-03-11 14:07:52 -04:00
parent 8ae0db925b
commit 057999f0fc
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 6 additions and 16 deletions

View file

@ -726,16 +726,13 @@ seekExportContent o rs (currbranch, _) = or <$> forM rs go
(exported, mtbcommitsha) <- case remoteAnnexTrackingBranch (Remote.gitconfig r) of
Nothing -> nontracking r
Just b -> do
mtree <- inRepo $ Git.Ref.tree b
mtbcommitsha <- Command.Export.getExportCommit r b
mcur <- maybe
(return Nothing)
(inRepo . Git.Ref.tree)
(fmap snd mtbcommitsha)
case mcur of
Nothing -> nontracking r
Just cur -> do
Command.Export.changeExport r db cur
return ([mkExported cur []], mtbcommitsha)
case (mtree, mtbcommitsha) of
(Just tree, Just _) -> do
Command.Export.changeExport r db tree
return ([mkExported tree []], mtbcommitsha)
_ -> nontracking r
fillexport r db (exportedTreeishes exported) mtbcommitsha
nontracking r = do

View file

@ -10,13 +10,6 @@ this.
## implementation notes
* Does sync --content with remote.name.annex-tracking-branch=master:subdir
export the right tree and update the remote tracking branch right?
Does it import correctly?
* Need to support annex-tracking-branch configuration, which documentation
says makes git-annex sync and assistant do imports.
* 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.