summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-09-30 12:48:40 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-09-30 12:48:40 -0400
commit9463c439fa8f8dbc1cebae518263ab0e5604547c (patch)
tree9cad91cb220df2a9eea3d5de4f2b063b58dbc0a6
parent1f7eb73c4cb97ea251c29e0680e1eb63b9c02ba0 (diff)
fix direct mode switch permissions problem
Similar to how a similar problem with indirect was earlier fixed.
-rw-r--r--Command/Direct.hs14
-rw-r--r--debian/changelog2
-rw-r--r--doc/bugs/rename:_permission_denied__44___after_direct_mode_switch.mdwn4
3 files changed, 17 insertions, 3 deletions
diff --git a/Command/Direct.hs b/Command/Direct.hs
index 7835988b4..7485f41ce 100644
--- a/Command/Direct.hs
+++ b/Command/Direct.hs
@@ -7,6 +7,8 @@
module Command.Direct where
+import Control.Exception.Extensible
+
import Common.Annex
import Command
import qualified Git
@@ -15,6 +17,7 @@ import qualified Git.LsFiles
import Config
import Annex.Direct
import Annex.Version
+import Annex.Exception
def :: [Command]
def = [notBareRepo $ noDaemonRunning $
@@ -51,10 +54,17 @@ perform = do
Nothing -> noop
Just a -> do
showStart "direct" f
- a
- showEndOk
+ r <- tryAnnex a
+ case r of
+ Left e -> warnlocked e
+ Right _ -> showEndOk
return Nothing
+ warnlocked :: SomeException -> Annex ()
+ warnlocked e = do
+ warning $ show e
+ warning "leaving this file as-is; correct this problem and run git annex fsck on it"
+
cleanup :: CommandCleanup
cleanup = do
showStart "direct" ""
diff --git a/debian/changelog b/debian/changelog
index 60bb23186..79815bef6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,7 +13,7 @@ git-annex (4.20130921) UNRELEASED; urgency=low
* assistant: Clear the list of failed transfers when doing a full transfer
scan. This prevents repeated retries to download files that are not
available, or are not referenced by the current git tree.
- * indirect: Better behavior when a file in direct mode is not owned by
+ * indirect, direct: Better behavior when a file is not owned by
the user running the conversion.
* add, import, assistant: Better preserve the mtime of symlinks,
when when adding content that gets deduplicated.
diff --git a/doc/bugs/rename:_permission_denied__44___after_direct_mode_switch.mdwn b/doc/bugs/rename:_permission_denied__44___after_direct_mode_switch.mdwn
index 16f243e9a..c315d4789 100644
--- a/doc/bugs/rename:_permission_denied__44___after_direct_mode_switch.mdwn
+++ b/doc/bugs/rename:_permission_denied__44___after_direct_mode_switch.mdwn
@@ -75,3 +75,7 @@ failed
git-annex: copy: 1 failed
camaar%
"""]]
+
+> Put in a fix that works, although perhaps not ideal as I do not
+> understand how the repo got into the original problem state. [[done]]
+> --[[Joey]]