* Using git-annex view in an adjusted branch, or git-annex adjust in a
view branch, will enter an adjusted view branch.
+ * sync: Fix a reversion that prevented sending files to exporttree=yes
+ remotes when annex-tracking-branch was configured to branch:subdir
+ (Introduced in version 10.20230214)
* status: This command is deprecated because it was only needed in direct
mode; git status --short is very similar.
* Windows: Support long filenames in more (possibly all) of the code.
| not (pullOption o) || not wantpull = noop
| otherwise = case remoteAnnexTrackingBranch (Remote.gitconfig remote) of
Nothing -> noop
- Just tb -> do
- let (b, p) = separate' (== (fromIntegral (ord ':'))) (Git.fromRef' tb)
- let branch = Git.Ref b
- let subdir = if S.null p
- then Nothing
- else Just (asTopFilePath p)
+ Just b -> do
+ let (branch, subdir) = splitRemoteAnnexTrackingBranchSubdir b
if canImportKeys remote importcontent
then do
Command.Import.seekRemote remote branch subdir importcontent (CheckGitIgnore True)
Nothing -> cannotupdateexport r db Nothing True
Just b -> do
mtree <- inRepo $ Git.Ref.tree b
+ let addsubdir = case snd (splitRemoteAnnexTrackingBranchSubdir b) of
+ Just subdir -> \cb -> Git.Ref $
+ Git.fromRef' cb <> ":" <> getTopFilePath subdir
+ Nothing -> id
mcurrtree <- maybe (pure Nothing)
- (inRepo . Git.Ref.tree)
+ (inRepo . Git.Ref.tree . addsubdir)
currbranch
mtbcommitsha <- Command.Export.getExportCommit r b
case (mtree, mcurrtree, mtbcommitsha) of
isThirdPartyPopulated :: Remote -> Bool
isThirdPartyPopulated = Remote.thirdPartyPopulated . Remote.remotetype
+
+splitRemoteAnnexTrackingBranchSubdir :: Git.Ref -> (Git.Ref, Maybe TopFilePath)
+splitRemoteAnnexTrackingBranchSubdir tb = (branch, subdir)
+ where
+ (b, p) = separate' (== (fromIntegral (ord ':'))) (Git.fromRef' tb)
+ branch = Git.Ref b
+ subdir = if S.null p
+ then Nothing
+ else Just (asTopFilePath p)