diff options
-rw-r--r-- | Git/DiffTree.hs | 11 | ||||
-rw-r--r-- | Git/DiffTreeItem.hs | 24 | ||||
-rw-r--r-- | Git/UpdateIndex.hs | 2 | ||||
-rw-r--r-- | Utility/Path.hs | 5 | ||||
-rw-r--r-- | debian/changelog | 1 |
5 files changed, 31 insertions, 12 deletions
diff --git a/Git/DiffTree.hs b/Git/DiffTree.hs index d2148458c..5981ed1a2 100644 --- a/Git/DiffTree.hs +++ b/Git/DiffTree.hs @@ -16,25 +16,16 @@ module Git.DiffTree ( ) where import Numeric -import System.Posix.Types import Common import Git import Git.Sha import Git.Command import Git.FilePath +import Git.DiffTreeItem import qualified Git.Filename import qualified Git.Ref -data DiffTreeItem = DiffTreeItem - { srcmode :: FileMode - , dstmode :: FileMode - , srcsha :: Sha -- nullSha if file was added - , dstsha :: Sha -- nullSha if file was deleted - , status :: String - , file :: TopFilePath - } deriving Show - {- Checks if the DiffTreeItem modifies a file with a given name - or under a directory by that name. -} isDiffOf :: DiffTreeItem -> TopFilePath -> Bool diff --git a/Git/DiffTreeItem.hs b/Git/DiffTreeItem.hs new file mode 100644 index 000000000..2389b698a --- /dev/null +++ b/Git/DiffTreeItem.hs @@ -0,0 +1,24 @@ +{- git diff-tree item + - + - Copyright 2012 Joey Hess <joey@kitenet.net> + - + - Licensed under the GNU GPL version 3 or higher. + -} + +module Git.DiffTreeItem ( + DiffTreeItem(..), +) where + +import System.Posix.Types + +import Git.FilePath +import Git.Types + +data DiffTreeItem = DiffTreeItem + { srcmode :: FileMode + , dstmode :: FileMode + , srcsha :: Sha -- nullSha if file was added + , dstsha :: Sha -- nullSha if file was deleted + , status :: String + , file :: TopFilePath + } deriving Show diff --git a/Git/UpdateIndex.hs b/Git/UpdateIndex.hs index a569d7740..613596d57 100644 --- a/Git/UpdateIndex.hs +++ b/Git/UpdateIndex.hs @@ -29,7 +29,7 @@ import Git.Types import Git.Command import Git.FilePath import Git.Sha -import qualified Git.DiffTree as Diff +import qualified Git.DiffTreeItem as Diff {- Streamers are passed a callback and should feed it lines in the form - read by update-index, and generated by ls-tree. -} diff --git a/Utility/Path.hs b/Utility/Path.hs index d21452efd..c3e893d16 100644 --- a/Utility/Path.hs +++ b/Utility/Path.hs @@ -21,6 +21,7 @@ import Control.Applicative import qualified System.FilePath.Posix as Posix #else import System.Posix.Files +import Utility.Exception #endif import qualified "MissingH" System.Path as MissingH @@ -255,7 +256,9 @@ fileNameLengthLimit :: FilePath -> IO Int fileNameLengthLimit _ = return 255 #else fileNameLengthLimit dir = do - l <- fromIntegral <$> getPathVar dir FileNameLimit + -- getPathVar can fail due to statfs(2) overflow + l <- catchDefaultIO 0 $ + fromIntegral <$> getPathVar dir FileNameLimit if l <= 0 then return 255 else return $ minimum [l, 255] diff --git a/debian/changelog b/debian/changelog index 63b2adf36..6c1bad91b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ git-annex (5.20141220) UNRELEASED; urgency=medium * vicfg: Avoid crashing on badly encoded config data. + * Work around statfs() overflow on some XFS systems. -- Joey Hess <id@joeyh.name> Mon, 22 Dec 2014 15:16:38 -0400 |