fix export subtree reversion

Fix reversion in last release that caused wrong tree to be written to
remote tracking branch after an export of a subtree.

The invariant "commitsha should have the treesha as its tree"
was not met due to a bug. Guarantee it's met by catting the commitsha
to find its actual tree. A little bit slower, but this is not run often.
This commit is contained in:
Joey Hess 2019-05-06 13:56:39 -04:00
parent 0533fde73c
commit bf7ecd6892
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 42 additions and 9 deletions

View file

@ -235,7 +235,7 @@ fillExport r db newtree mtbcommitsha = do
Nothing -> noop
Just (tb, commitsha) ->
whenM (liftIO $ fromAllFilled <$> takeMVar allfilledvar) $
makeRemoteTrackingBranchMergeCommit tb commitsha newtree
makeRemoteTrackingBranchMergeCommit tb commitsha
>>= setRemoteTrackingBranch tb
liftIO $ fromFileUploaded <$> takeMVar cvar