diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-03-11 16:30:06 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-03-11 16:30:06 -0400 |
commit | e1eab3343efe8b583cf9c6e542d8a33fad1e80b5 (patch) | |
tree | f2a77545c33caf37e898855df570fa37a115e9ce /Annex | |
parent | 92e8a321090bb45e0ae37e4298160f56652b1f1f (diff) |
fix deletion of files in adjustTree
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/AdjustedBranch.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Annex/AdjustedBranch.hs b/Annex/AdjustedBranch.hs index ce565a754..030bdb99e 100644 --- a/Annex/AdjustedBranch.hs +++ b/Annex/AdjustedBranch.hs @@ -142,7 +142,7 @@ adjustTree :: Adjustment -> Direction -> Ref -> Annex Sha adjustTree adj direction orig = do h <- inRepo hashObjectStart let toadj = adjustTreeItem adj direction h - treesha <- Git.Tree.adjustTree toadj [] orig =<< Annex.gitRepo + treesha <- Git.Tree.adjustTree toadj [] [] orig =<< Annex.gitRepo liftIO $ hashObjectStop h return treesha @@ -293,11 +293,15 @@ reverseAdjustedCommit h newparent adj (csha, c) origbranch Left $ "unable to propigate merge commit " ++ show csha ++ " back to " ++ show origbranch | otherwise = do (diff, cleanup) <- inRepo (Git.DiffTree.commitDiff csha) - let (adds, changes) = partition (\dti -> Git.DiffTree.srcsha dti == nullSha) diff + let (adds, others) = partition (\dti -> Git.DiffTree.srcsha dti == nullSha) diff + let (removes, changes) = partition (\dti -> Git.DiffTree.dstsha dti == nullSha) others adds' <- catMaybes <$> mapM (adjustTreeItem adj Reverse h) (map diffTreeToTreeItem adds) - treesha <- Git.Tree.adjustTree (propchanges changes) - adds' newparent + treesha <- Git.Tree.adjustTree + (propchanges changes) + adds' + (map Git.DiffTree.file removes) + newparent =<< Annex.gitRepo void $ liftIO cleanup revadjcommit <- inRepo $ commitWithMetaData |