4d786ebe4a
It's ok to probe every time for git-branch remove because that's run quite rarely. For git-checkattr, it's run only once, when starting the --batch mode, and so again the overhead is pretty minimal. This leaves 2 places where the build version is still used. git merge might be interactive or fail if one skews, and --no-gpg-sign might not be pased, or might be passed to a git that doesn't understand it if the other skews. It seems a little expensive to check the git version each time these are used. This doesn't seem likely to cause many problems, at least compared with check-attr hanging on skew.
29 lines
535 B
Haskell
29 lines
535 B
Haskell
{- git remote stuff
|
|
-
|
|
- Copyright 2012 Joey Hess <joey@kitenet.net>
|
|
-
|
|
- 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
|
|
import qualified Git.Version
|
|
|
|
remove :: RemoteName -> Repo -> IO ()
|
|
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
|