aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-06-11 10:33:58 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-06-11 10:33:58 -0400
commit7f70767bfb2ada474274c1dfad0e1a6d60955402 (patch)
treef9abf52f8f9cc25a334a80cbdd4fb7255df71154
parent28242b3bf8d75bf5b789830b66b90cec92e296d5 (diff)
uninit: Refuse to run in a subdirectory. Closes: #677076
-rw-r--r--Command/Uninit.hs6
-rw-r--r--debian/changelog5
2 files changed, 8 insertions, 3 deletions
diff --git a/Command/Uninit.hs b/Command/Uninit.hs
index d6283a77d..5724bffd0 100644
--- a/Command/Uninit.hs
+++ b/Command/Uninit.hs
@@ -23,9 +23,13 @@ def = [addCheck check $ command "uninit" paramPaths seek
check :: Annex ()
check = do
- b <- current_branch
+ b <- current_branch
when (b == Annex.Branch.name) $ error $
"cannot uninit when the " ++ show b ++ " branch is checked out"
+ top <- fromRepo Git.repoPath
+ cwd <- liftIO getCurrentDirectory
+ whenM ((/=) <$> liftIO (absPath top) <*> liftIO (absPath cwd)) $ error $
+ "can only run uninit from the top of the git repository"
where
current_branch = Git.Ref . Prelude.head . lines <$> revhead
revhead = inRepo $ Git.Command.pipeRead
diff --git a/debian/changelog b/debian/changelog
index 8a734e0aa..a058a1796 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,11 @@
-git-annex (3.20120606) UNRELEASED; urgency=low
+git-annex (3.20120611) unstable; urgency=medium
* add: Prevent (most) modifications from being made to a file while it
is being added to the annex.
* initremote: Automatically describe a remote when creating it.
+ * uninit: Refuse to run in a subdirectory. Closes: #677076
- -- Joey Hess <joeyh@debian.org> Tue, 05 Jun 2012 20:25:51 -0400
+ -- Joey Hess <joeyh@debian.org> Mon, 11 Jun 2012 10:32:01 -0400
git-annex (3.20120605) unstable; urgency=low