aboutsummaryrefslogtreecommitdiff
path: root/Git/CatFile.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-03-03 14:57:16 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-03-03 14:57:16 -0400
commita9067868a8594577ead2ecbe55f9563bef12f26d (patch)
tree1694cea1754589a7cf0d8ed3096e03d9d430b99d /Git/CatFile.hs
parent8d6edac6f48a4bf1522b68a30db579193c097e7a (diff)
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)
Diffstat (limited to 'Git/CatFile.hs')
-rw-r--r--Git/CatFile.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Git/CatFile.hs b/Git/CatFile.hs
index c8cb76d59..c7c51b894 100644
--- a/Git/CatFile.hs
+++ b/Git/CatFile.hs
@@ -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