fix union merge to call diff-index with -- after the ref

Otherwise, if there's a file in the repo with a name matching the ref,
git could get confused and the merge not work.
This commit is contained in:
Joey Hess 2015-04-09 21:12:59 -04:00
parent 06211738c1
commit 2879adc551
2 changed files with 6 additions and 3 deletions

View file

@ -55,8 +55,8 @@ mergeTrees (Ref x) (Ref y) h = doMerge h $ "diff-tree":diffOpts ++ [x, y]
{- For merging a single tree into the index. -}
mergeTreeIndex :: Ref -> CatFileHandle -> Repo -> Streamer
mergeTreeIndex (Ref x) h = doMerge h $
"diff-index" : diffOpts ++ ["--cached", x]
mergeTreeIndex (Ref r) h = doMerge h $
"diff-index" : diffOpts ++ ["--cached", r, "--"]
diffOpts :: [String]
diffOpts = ["--raw", "-z", "-r", "--no-renames", "-l0"]