aboutsummaryrefslogtreecommitdiff
path: root/Git/UnionMerge.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-01-06 17:24:03 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-01-06 17:24:03 -0400
commit9fb5f3edc7e0aec79e38cf588b66e66e4a2bdd3c (patch)
treed114c9c52685160c2e4c2244676cbd1f5563f9c4 /Git/UnionMerge.hs
parent47646d44b7a391d9439998ba34498f2fb74b4259 (diff)
log --after=date
Diffstat (limited to 'Git/UnionMerge.hs')
-rw-r--r--Git/UnionMerge.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/Git/UnionMerge.hs b/Git/UnionMerge.hs
index d5323af1d..4b335e47b 100644
--- a/Git/UnionMerge.hs
+++ b/Git/UnionMerge.hs
@@ -103,14 +103,13 @@ calc_merge ch differ repo streamer = gendiff >>= go
- a line suitable for update_index that union merges the two sides of the
- diff. -}
mergeFile :: String -> FilePath -> CatFileHandle -> Repo -> IO (Maybe String)
-mergeFile info file h repo = case filter (/= nullsha) [Ref asha, Ref bsha] of
+mergeFile info file h repo = case filter (/= nullSha) [Ref asha, Ref bsha] of
[] -> return Nothing
(sha:[]) -> use sha
shas -> use =<< either return (hashObject repo . L.unlines) =<<
calcMerge . zip shas <$> mapM getcontents shas
where
[_colonmode, _bmode, asha, bsha, _status] = words info
- nullsha = Ref $ replicate shaSize '0'
getcontents s = L.lines <$> catObject h s
use sha = return $ Just $ update_index_line sha file