assistant: When built with git before 1.8.0, use git remote rm to delete a remote. Newer git uses git remote remove.

This commit is contained in:
Joey Hess 2013-04-22 16:53:09 -04:00
parent 9ca9c1f747
commit 450baa02e9
3 changed files with 17 additions and 1 deletions

View file

@ -18,6 +18,7 @@ import Assistant.DaemonStatus
import qualified Remote import qualified Remote
import Remote.List import Remote.List
import qualified Git.Command import qualified Git.Command
import qualified Git.Version
import Logs.Trust import Logs.Trust
import qualified Annex import qualified Annex
@ -36,7 +37,11 @@ disableRemote uuid = do
liftAnnex $ do liftAnnex $ do
inRepo $ Git.Command.run inRepo $ Git.Command.run
[ Param "remote" [ Param "remote"
, Param "remove" -- name of this subcommand changed
, Param $
if Git.Version.older "1.8.0"
then "rm"
else "remove"
, Param (Remote.name remote) , Param (Remote.name remote)
] ]
void $ remoteListRefresh void $ remoteListRefresh

2
debian/changelog vendored
View file

@ -18,6 +18,8 @@ git-annex (4.20130418) UNRELEASED; urgency=low
rather than initializing a bare repository in the same directory. rather than initializing a bare repository in the same directory.
* direct, indirect: Refuse to do anything when the assistant * direct, indirect: Refuse to do anything when the assistant
or git-annex watch daemon is running. or git-annex watch daemon is running.
* assistant: When built with git before 1.8.0, use `git remote rm`
to delete a remote. Newer git uses `git remote remove`.
-- Joey Hess <joeyh@debian.org> Thu, 18 Apr 2013 16:22:48 -0400 -- Joey Hess <joeyh@debian.org> Thu, 18 Apr 2013 16:22:48 -0400

View file

@ -35,3 +35,12 @@ The log shows:
> Seems that `git remote remove` is new as of git 1.8.0 or so.
> Older gits only support `git remote rm`. Which newer gits
> support as well. but it seems to be in the process
> of being deprecated so I'd rather not use it.
>
> So, I've made the version of git it's
> built for determine which subcommand it uses. [[done]] --[[Joey]]
>
> (You can run `git remote rm repo` by hand to clean up from this BTW.)