summaryrefslogtreecommitdiff
path: root/Command/AddUrl.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2014-12-11 20:10:45 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2014-12-11 20:10:45 -0400
commit743dcc87eee871833b3c676fcd0fcb16f6ad3349 (patch)
treefa351fc121bb58c0d068141a41af8c82113b0291 /Command/AddUrl.hs
parent892eac7f77f0e54fc8003ca9e306a76d59ebc519 (diff)
truncate over-long paths
Diffstat (limited to 'Command/AddUrl.hs')
-rw-r--r--Command/AddUrl.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs
index 825d9bdbf..667d72895 100644
--- a/Command/AddUrl.hs
+++ b/Command/AddUrl.hs
@@ -81,9 +81,11 @@ seek us = do
startRemote :: Remote -> Bool -> FilePath -> URLString -> Maybe Integer -> CommandStart
startRemote r relaxed file uri sz = do
- showStart "addurl" file
+ pathmax <- liftIO $ fileNameLengthLimit "."
+ let file' = truncateFilePath pathmax file
+ showStart "addurl" file'
showNote $ "from " ++ Remote.name r
- next $ performRemote r relaxed uri file sz
+ next $ performRemote r relaxed uri file' sz
performRemote :: Remote -> Bool -> URLString -> FilePath -> Maybe Integer -> CommandPerform
performRemote r relaxed uri file sz = ifAnnexed file adduri geturi