diff options
-rw-r--r-- | Assistant/MakeRemote.hs | 14 | ||||
-rw-r--r-- | doc/bugs/removable_device_configurator_chokes_on_spaces.mdwn | 2 |
2 files changed, 11 insertions, 5 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/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]] |