summaryrefslogtreecommitdiff
path: root/Command/Unused.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-06-04 14:03:41 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-06-04 14:03:41 -0400
commit4806fcbd7a7b32fa635b7972adf8046dc2333f93 (patch)
treedcc5c40bdb3e4d547f95716aeb529b0d34aa0e63 /Command/Unused.hs
parentad4863a4035f9e367d7fd685b00c768f69cc9c3d (diff)
unused: Avoid checking view branches for unused files.
This avoids a potential slowdown when using lots of views. I think that it makes sense for unused to ignore (local) view branches, since these are by definition supposed to be views of an existing branch, so looking at the branch should be sufficient (and if the view is out of date and has files that have since been deleted from the branch, the user's intent is not to preserve those from unused reaping).
Diffstat (limited to 'Command/Unused.hs')
-rw-r--r--Command/Unused.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/Command/Unused.hs b/Command/Unused.hs
index 5815bbf29..6737109f6 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -35,6 +35,7 @@ import qualified Annex.Branch
import Annex.CatFile
import Types.Key
import Git.FilePath
+import Logs.View (is_branchView)
def :: [Command]
def = [withOptions [unusedFromOption] $ command "unused" paramNothing seek
@@ -270,6 +271,7 @@ withKeysReferencedInGit a = do
ourbranchend = '/' : Git.fromRef Annex.Branch.name
ourbranches (_, b) = not (ourbranchend `isSuffixOf` b)
&& not ("refs/synced/" `isPrefixOf` b)
+ && not (is_branchView (Git.Ref b))
addHead headRef refs = case headRef of
-- if HEAD diverges from all branches (except the branch it
-- points to), run the actions on staged keys (and keys