fix sync bug in direct mode

sync: Fix bug that prevented pulling changes into direct mode repositories
that were committed to remotes using git commit rather than git-annex sync.

This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
Joey Hess 2018-02-26 14:10:03 -04:00
parent 42f154bd7e
commit db057dcff0
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 21 additions and 1 deletions

View file

@ -30,6 +30,9 @@ git-annex (6.20180113) UNRELEASED; urgency=medium
can be used to disable automatic merge of git-annex branches.
* tips/automatically_adding_metadata/pre-commit-annex: Fix to not
silently skip filenames containing non-ascii characters.
* sync: Fix bug that prevented pulling changes into direct mode
repositories that were committed to remotes using git commit
rather than git-annex sync.
-- Joey Hess <id@joeyh.name> Wed, 24 Jan 2018 20:42:55 -0400

View file

@ -434,7 +434,7 @@ mergeRemote remote currbranch mergeconfig resolvemergeoverride = ifM isBareRepo
(mapM (merge currbranch mergeconfig resolvemergeoverride Git.Branch.ManualCommit . remoteBranch remote) =<< getlist)
tomerge = filterM (changed remote)
branchlist Nothing = []
branchlist (Just branch) = [branch, syncBranch branch]
branchlist (Just branch) = [fromDirectBranch (fromAdjustedBranch branch), syncBranch branch]
pushRemote :: SyncOptions -> Remote -> CurrBranch -> CommandStart
pushRemote _o _remote (Nothing, _) = stop

View file

@ -112,3 +112,5 @@ index 0000000..d00491f
6.20180206+gitg638032f3a-1~ndall+1
[[!meta author=yoh]]
> [[fixed|done]] --[[Joey]]

View file

@ -0,0 +1,15 @@
[[!comment format=mdwn
username="joey"
subject="""comment 1"""
date="2018-02-26T17:38:05Z"
content="""
Seems that it's only merging from remotes/origin/synced/master, not
remotes/origin/master. When `git annex sync` is used in the first
repository, that works, but not when `git commit` is used.
And it's due to being in direct mode because the annex/direct/master
branch is checked out, so it tries to merge from
remotes/origin/direct/master, which doesn't exist.
This does not seem to be a reversion, but a long-ago oversight.
"""]]