diff options
author | Joey Hess <joey@kitenet.net> | 2012-12-18 15:04:44 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-12-18 15:04:44 -0400 |
commit | 10d77d95f454a2fb2806c031a14344dd7cdea006 (patch) | |
tree | b9ba63e2f844031d4fd1d8248e5b01e7b5be7902 /Git/DiffTree.hs | |
parent | 19e46a374225bc37131454774f20da4c6a7779d9 (diff) |
direct mode merging works!
Automatic merge resoltion code needs to be fixed to preserve objects from
direct mode files.
Diffstat (limited to 'Git/DiffTree.hs')
-rw-r--r-- | Git/DiffTree.hs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Git/DiffTree.hs b/Git/DiffTree.hs index 7281255f5..af230b495 100644 --- a/Git/DiffTree.hs +++ b/Git/DiffTree.hs @@ -8,6 +8,7 @@ module Git.DiffTree ( DiffTreeItem(..), diffTree, + diffTreeRecursive, parseDiffTree ) where @@ -31,9 +32,19 @@ data DiffTreeItem = DiffTreeItem {- Diffs two tree Refs. -} diffTree :: Ref -> Ref -> Repo -> IO ([DiffTreeItem], IO Bool) -diffTree src dst repo = do - (diff, cleanup) <- pipeNullSplit [Params "diff-tree -z --raw --no-renames -l0", Param (show src), Param (show dst)] repo +diffTree = diffTree' [] + +{- Diffs two tree Refs, recursing into sub-trees -} +diffTreeRecursive :: Ref -> Ref -> Repo -> IO ([DiffTreeItem], IO Bool) +diffTreeRecursive = diffTree' [Param "-r"] + +diffTree' :: [CommandParam] -> Ref -> Ref -> Repo -> IO ([DiffTreeItem], IO Bool) +diffTree' params src dst repo = do + (diff, cleanup) <- pipeNullSplit ps repo return (parseDiffTree diff, cleanup) + where + ps = Params "diff-tree -z --raw --no-renames -l0" : params ++ + [Param (show src), Param (show dst)] {- Parses diff-tree output. -} parseDiffTree :: [String] -> [DiffTreeItem] |