[[!comment format=mdwn
 username="joey"
 subject="""comment 17"""
 date="2023-06-06T19:07:25Z"
 content="""
Another expensive thing sync has to do, due to the adjusted branch
being checked out, is Command.Sync.updateBranches. In my repo with 10000
files, when not using --content, that is responsible for most of the run
time of a sync when there is nothing new to import or pull.

That happens because `git-annex adjust --unlock-present` was used. So sync
needs to update the branch if there have been any changes to the content
that is present. Currently when in such an adjusted branch, it re-builds
the branch every time it's run. 

It would be possible to avoid that when there have been no changes to the
content that is present, but it would need to deal with eg a previous sync
command having transferred some content before it was interrupted. So it
would need some kind of flag file to be written when content changes.

(With the master branch checked out instead, `git-annex sync --content` is
now as fast as `git-annex find --not --in source`.)
"""]]
