summaryrefslogtreecommitdiff
path: root/Git
diff options
context:
space:
mode:
Diffstat (limited to 'Git')
-rw-r--r--Git/CatFile.hs2
-rw-r--r--Git/FileMode.hs5
2 files changed, 5 insertions, 2 deletions
diff --git a/Git/CatFile.hs b/Git/CatFile.hs
index 984d2f465..bd86ff326 100644
--- a/Git/CatFile.hs
+++ b/Git/CatFile.hs
@@ -130,4 +130,4 @@ catTree h treeref = go <$> catObjectDetails h treeref
parsemodefile b =
let (modestr, file) = separate (== ' ') (encodeW8 $ L.unpack b)
in (file, readmode modestr)
- readmode = fst . Prelude.head . readOct
+ readmode = fst . fromMaybe (0, undefined) . headMaybe . readOct
diff --git a/Git/FileMode.hs b/Git/FileMode.hs
index d42df9833..fc4d0264e 100644
--- a/Git/FileMode.hs
+++ b/Git/FileMode.hs
@@ -13,8 +13,11 @@ import Utility.FileMode
import System.PosixCompat.Types
+symLinkMode :: FileMode
+symLinkMode = 40960
+
{- Git uses a special file mode to indicate a symlink. This is the case
- even on Windows, so we hard code the valuse here, rather than using
- System.Posix.Files.symbolicLinkMode. -}
isSymLink :: FileMode -> Bool
-isSymLink = checkMode 40960
+isSymLink = checkMode symLinkMode