summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-04-22 16:53:09 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-04-22 16:53:09 -0400
commit822c2d920882dd7eea8ed551369fa4bb5b26afa3 (patch)
treeb57a4525bfa2dec52823e30e5090a90f69d78741
parent26264f5fb4e90cdbc5bfc83bbe3d317b19bbf7da (diff)
assistant: When built with git before 1.8.0, use `git remote rm` to delete a remote. Newer git uses `git remote remove`.
-rw-r--r--Assistant/DeleteRemote.hs7
-rw-r--r--debian/changelog2
-rw-r--r--doc/bugs/Repository_deletion_error.mdwn9
3 files changed, 17 insertions, 1 deletions
diff --git a/Assistant/DeleteRemote.hs b/Assistant/DeleteRemote.hs
index 25049103e..de3d4124b 100644
--- a/Assistant/DeleteRemote.hs
+++ b/Assistant/DeleteRemote.hs
@@ -18,6 +18,7 @@ import Assistant.DaemonStatus
import qualified Remote
import Remote.List
import qualified Git.Command
+import qualified Git.Version
import Logs.Trust
import qualified Annex
@@ -36,7 +37,11 @@ disableRemote uuid = do
liftAnnex $ do
inRepo $ Git.Command.run
[ 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)
]
void $ remoteListRefresh
diff --git a/debian/changelog b/debian/changelog
index e249cad87..a6bd997ee 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,8 @@ git-annex (4.20130418) UNRELEASED; urgency=low
rather than initializing a bare repository in the same directory.
* direct, indirect: Refuse to do anything when the assistant
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
diff --git a/doc/bugs/Repository_deletion_error.mdwn b/doc/bugs/Repository_deletion_error.mdwn
index faebf2a83..33142d8dd 100644
--- a/doc/bugs/Repository_deletion_error.mdwn
+++ b/doc/bugs/Repository_deletion_error.mdwn
@@ -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.)