uninit: Delete the git-annex branch.
This commit is contained in:
parent
bd54dadb0b
commit
5c63b409d4
2 changed files with 18 additions and 5 deletions
|
@ -9,6 +9,7 @@ module Command.Uninit where
|
||||||
|
|
||||||
import Control.Monad.State (liftIO)
|
import Control.Monad.State (liftIO)
|
||||||
import System.Directory
|
import System.Directory
|
||||||
|
import System.Exit
|
||||||
|
|
||||||
import Command
|
import Command
|
||||||
import Messages
|
import Messages
|
||||||
|
@ -18,6 +19,8 @@ import qualified Git
|
||||||
import qualified Annex
|
import qualified Annex
|
||||||
import qualified Command.Unannex
|
import qualified Command.Unannex
|
||||||
import qualified Command.Init
|
import qualified Command.Init
|
||||||
|
import qualified Branch
|
||||||
|
import Content
|
||||||
|
|
||||||
command :: [Command]
|
command :: [Command]
|
||||||
command = [repoCommand "uninit" paramPath seek
|
command = [repoCommand "uninit" paramPath seek
|
||||||
|
@ -27,15 +30,19 @@ seek :: [CommandSeek]
|
||||||
seek = [withFilesInGit Command.Unannex.start, withNothing start]
|
seek = [withFilesInGit Command.Unannex.start, withNothing start]
|
||||||
|
|
||||||
start :: CommandStartNothing
|
start :: CommandStartNothing
|
||||||
start = do
|
start = next perform
|
||||||
showStart "uninit" ""
|
|
||||||
next perform
|
|
||||||
|
|
||||||
perform :: CommandPerform
|
perform :: CommandPerform
|
||||||
perform = do
|
perform = next cleanup
|
||||||
|
|
||||||
|
cleanup :: CommandCleanup
|
||||||
|
cleanup = do
|
||||||
g <- Annex.gitRepo
|
g <- Annex.gitRepo
|
||||||
gitPreCommitHookUnWrite g
|
gitPreCommitHookUnWrite g
|
||||||
next $ return True
|
saveState
|
||||||
|
liftIO $ Git.run g "branch" [Param "-D", Param Branch.name]
|
||||||
|
-- bypass normal shutdown, which writes to the deleted branch
|
||||||
|
liftIO exitSuccess
|
||||||
|
|
||||||
gitPreCommitHookUnWrite :: Git.Repo -> Annex ()
|
gitPreCommitHookUnWrite :: Git.Repo -> Annex ()
|
||||||
gitPreCommitHookUnWrite repo = do
|
gitPreCommitHookUnWrite repo = do
|
||||||
|
|
6
debian/changelog
vendored
6
debian/changelog
vendored
|
@ -1,3 +1,9 @@
|
||||||
|
git-annex (3.20110703) UNRELEASED; urgency=low
|
||||||
|
|
||||||
|
* uninit: Delete the git-annex branch.
|
||||||
|
|
||||||
|
-- Joey Hess <joeyh@debian.org> Mon, 04 Jul 2011 15:50:21 -0400
|
||||||
|
|
||||||
git-annex (3.20110702) unstable; urgency=low
|
git-annex (3.20110702) unstable; urgency=low
|
||||||
|
|
||||||
* Now the web can be used as a special remote.
|
* Now the web can be used as a special remote.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue