summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-04-27 12:21:38 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-04-27 12:21:38 -0400
commite0b7012ccc405dedb556b8c940eb66e42304bc73 (patch)
tree6a7093d721d4e1ad4933a1255e057c7df5189135
parenta2ee4386bb8f64046a5838038c89492dddcce94f (diff)
uninit: Clear annex.uuid from .git/config. Closes: #670639
-rw-r--r--Annex/UUID.hs8
-rw-r--r--Init.hs4
-rw-r--r--debian/changelog1
3 files changed, 11 insertions, 2 deletions
diff --git a/Annex/UUID.hs b/Annex/UUID.hs
index e8306de90..5459cc7fe 100644
--- a/Annex/UUID.hs
+++ b/Annex/UUID.hs
@@ -16,12 +16,14 @@ module Annex.UUID (
getRepoUUID,
getUncachedUUID,
prepUUID,
- genUUID
+ genUUID,
+ removeRepoUUID,
) where
import Common.Annex
import qualified Git
import qualified Git.Config
+import qualified Git.Command
import qualified Build.SysConfig as SysConfig
import Config
@@ -61,6 +63,10 @@ getRepoUUID r = do
when (g /= r) $ storeUUID cachekey u
cachekey = remoteConfig r "uuid"
+removeRepoUUID :: Annex ()
+removeRepoUUID = inRepo $ Git.Command.run "config"
+ [Param "--unset", Param configkey]
+
getUncachedUUID :: Git.Repo -> UUID
getUncachedUUID = toUUID . Git.Config.get configkey ""
diff --git a/Init.hs b/Init.hs
index 9f1988a39..a0e16e881 100644
--- a/Init.hs
+++ b/Init.hs
@@ -29,7 +29,9 @@ initialize mdescription = do
maybe (recordUUID u) (describeUUID u) mdescription
uninitialize :: Annex ()
-uninitialize = gitPreCommitHookUnWrite
+uninitialize = do
+ gitPreCommitHookUnWrite
+ removeRepoUUID
{- Will automatically initialize if there is already a git-annex
branch from somewhere. Otherwise, require a manual init
diff --git a/debian/changelog b/debian/changelog
index 1962a6b66..06990a0f8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ git-annex (3.20120419) UNRELEASED; urgency=low
* Add annex.http-headers and annex.http-headers-command config
settings, to allow custom headers to be sent with all HTTP requests.
(Requested by the Internet Archive)
+ * uninit: Clear annex.uuid from .git/config. Closes: #670639
-- Joey Hess <joeyh@debian.org> Fri, 20 Apr 2012 16:14:08 -0400