sync: Fix bug in direct mode that caused a file not checked into git to be deleted when merging with a remote that added a file by the same name. (Thanks, jkt)
This commit is contained in:
parent
04b77328ef
commit
1192d98721
6 changed files with 91 additions and 39 deletions
|
@ -11,6 +11,7 @@ module Git.CatFile (
|
|||
catFileStart',
|
||||
catFileStop,
|
||||
catFile,
|
||||
catFileDetails,
|
||||
catTree,
|
||||
catObject,
|
||||
catObjectDetails,
|
||||
|
@ -52,6 +53,10 @@ catFile :: CatFileHandle -> Branch -> FilePath -> IO L.ByteString
|
|||
catFile h branch file = catObject h $ Ref $
|
||||
fromRef branch ++ ":" ++ toInternalGitPath file
|
||||
|
||||
catFileDetails :: CatFileHandle -> Branch -> FilePath -> IO (Maybe (L.ByteString, Sha, ObjectType))
|
||||
catFileDetails h branch file = catObjectDetails h $ Ref $
|
||||
fromRef branch ++ ":" ++ toInternalGitPath file
|
||||
|
||||
{- Uses a running git cat-file read the content of an object.
|
||||
- Objects that do not exist will have "" returned. -}
|
||||
catObject :: CatFileHandle -> Ref -> IO L.ByteString
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue