diff options
author | Joey Hess <joey@kitenet.net> | 2012-06-11 12:13:07 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-06-11 12:13:07 -0400 |
commit | a5a3cd55ac2bab656824e48d29ead8382c583b01 (patch) | |
tree | 1d5503b35e7fdb27bcd2e1e3f8f1020686882125 /Command | |
parent | 433ff41496b073c71e465af8b38b2ecafe27d8dd (diff) | |
parent | 5642e189b76070b43a8e24f9f49d36b950f83c8d (diff) |
Merge branch 'master' into watch
Conflicts:
debian/changelog
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Uninit.hs | 6 |
1 files changed, 5 insertions, 1 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 |