diff --git a/Assistant/WebApp/Configurators/Edit.hs b/Assistant/WebApp/Configurators/Edit.hs index c751f9d85f..e7321232f8 100644 --- a/Assistant/WebApp/Configurators/Edit.hs +++ b/Assistant/WebApp/Configurators/Edit.hs @@ -27,6 +27,7 @@ import Types.StandardGroups import qualified Config import qualified Git import qualified Git.Command +import qualified Git.Config import Yesod import Data.Text (Text) @@ -72,6 +73,16 @@ setRepoConfig uuid mremote oldc newc = do when (isJust mremote && repoName oldc /= repoName newc) $ do runAnnex undefined $ do name <- fromRepo $ uniqueRemoteName (T.unpack $ repoName newc) 0 + {- git remote rename expects there to be a + - remote..fetch, and exits nonzero if + - there's not. Special remotes don't normally + - have that, and don't use it. Temporarily add + - it if it's missing. -} + let remotefetch = "remote." ++ T.unpack (repoName oldc) ++ ".fetch" + needfetch <- isNothing <$> fromRepo (Git.Config.getMaybe remotefetch) + when needfetch $ + inRepo $ Git.Command.run "config" + [Param remotefetch, Param ""] inRepo $ Git.Command.run "remote" [ Param "rename" , Param $ T.unpack $ repoName oldc diff --git a/debian/changelog b/debian/changelog index 9cfce3c464..b7baf66e48 100644 --- a/debian/changelog +++ b/debian/changelog @@ -36,6 +36,7 @@ git-annex (3.20121018) UNRELEASED; urgency=low * webapp: Make an initial, empty commit so there is a master branch * assistant: Fix syncing local drives. * webapp: Fix creation of rsync.net repositories. + * webapp: Fix renaming of special remotes. -- Joey Hess Wed, 17 Oct 2012 14:24:10 -0400