2015-04-19 12:18:17 +00:00
|
|
|
{- git remote removal
|
2014-10-27 15:24:21 +00:00
|
|
|
-
|
2015-01-21 16:50:09 +00:00
|
|
|
- Copyright 2012 Joey Hess <id@joeyh.name>
|
2014-10-27 15:24:21 +00:00
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
{-# LANGUAGE CPP #-}
|
|
|
|
|
|
|
|
module Git.Remote.Remove where
|
|
|
|
|
|
|
|
import Common
|
|
|
|
import Git
|
|
|
|
import Git.Types
|
|
|
|
import qualified Git.Command
|
2015-01-05 19:54:52 +00:00
|
|
|
import qualified Git.Version
|
2014-10-27 15:24:21 +00:00
|
|
|
|
|
|
|
remove :: RemoteName -> Repo -> IO ()
|
2015-01-05 19:54:52 +00:00
|
|
|
remove remotename r = do
|
|
|
|
old <- Git.Version.older "1.8.0"
|
|
|
|
Git.Command.run
|
|
|
|
[ Param "remote"
|
|
|
|
-- name of this subcommand changed
|
|
|
|
, Param $
|
|
|
|
if old
|
|
|
|
then "rm"
|
|
|
|
else "remove"
|
|
|
|
, Param remotename
|
|
|
|
] r
|