summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Assistant/MakeRemote.hs14
-rw-r--r--Makefile2
-rw-r--r--doc/bugs/removable_device_configurator_chokes_on_spaces.mdwn2
3 files changed, 12 insertions, 6 deletions
diff --git a/Assistant/MakeRemote.hs b/Assistant/MakeRemote.hs
index 729b5126a..9184cb529 100644
--- a/Assistant/MakeRemote.hs
+++ b/Assistant/MakeRemote.hs
@@ -25,6 +25,7 @@ import Logs.Remote
import qualified Data.Text as T
import qualified Data.Map as M
+import Data.Char
{- Sets up and begins syncing with a new ssh or rsync remote. -}
makeSshRemote :: ThreadState -> DaemonStatusHandle -> ScanRemoteMap -> Bool -> SshData -> IO ()
@@ -99,14 +100,19 @@ makeRemote basename location a = do
samelocation x = Git.repoLocation x == location
{- Generate an unused name for a remote, adding a number if
- - necessary. -}
+ - necessary.
+ -
+ - Ensures that the returned name is a legal git remote name. -}
uniqueRemoteName :: String -> Int -> Git.Repo -> String
uniqueRemoteName basename n r
| null namecollision = name
- | otherwise = uniqueRemoteName basename (succ n) r
+ | otherwise = uniqueRemoteName legalbasename (succ n) r
where
namecollision = filter samename (Git.remotes r)
samename x = Git.remoteName x == Just name
name
- | n == 0 = basename
- | otherwise = basename ++ show n
+ | n == 0 = legalbasename
+ | otherwise = legalbasename ++ show n
+ legalbasename = filter legal basename
+ legal '_' = True
+ legal c = isAlphaNum c
diff --git a/Makefile b/Makefile
index 20138713e..10fdd76b1 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@ BASEFLAGS=-threaded -Wall $(IGNORE) -outputdir $(GIT_ANNEX_TMP_BUILD_DIR) -IUtil
# you can turn off some of these features.
#
# If you're using an old version of yesod, enable -DWITH_OLD_YESOD
-FEATURES?=-DWITH_ASSISTANT -DWITH_S3 -DWITH_WEBAPP -DWITH_PAIRING
+FEATURES?=$(GIT_ANNEX_LOCAL_FEATURES) -DWITH_ASSISTANT -DWITH_S3 -DWITH_WEBAPP -DWITH_PAIRING
bins=git-annex
mans=git-annex.1 git-annex-shell.1
diff --git a/doc/bugs/removable_device_configurator_chokes_on_spaces.mdwn b/doc/bugs/removable_device_configurator_chokes_on_spaces.mdwn
index d256071f4..e114877ec 100644
--- a/doc/bugs/removable_device_configurator_chokes_on_spaces.mdwn
+++ b/doc/bugs/removable_device_configurator_chokes_on_spaces.mdwn
@@ -15,4 +15,4 @@ The assistant produces an internal server error and subsequently crashes complet
git-annex 3.20120924 from the Debian package in sid on Debian wheezy, amd64.
-
+> Thanks for reporting this, I've fixed it in git. [[done]] --[[Joey]]