From 4806fcbd7a7b32fa635b7972adf8046dc2333f93 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 4 Jun 2014 14:03:41 -0400 Subject: 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). --- Logs/View.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Logs') diff --git a/Logs/View.hs b/Logs/View.hs index 79c2556b3..b2a92c405 100644 --- a/Logs/View.hs +++ b/Logs/View.hs @@ -15,6 +15,7 @@ module Logs.View ( removeView, recentViews, branchView, + is_branchView, prop_branchView_legal, ) where @@ -87,5 +88,10 @@ branchView view | Git.Ref.legal True s = s | otherwise = map (\c -> if isAlphaNum c then c else '_') s +is_branchView :: Git.Branch -> Bool +is_branchView (Ref b) + | b == branchViewPrefix = True + | otherwise = (branchViewPrefix ++ "/") `isPrefixOf` b + prop_branchView_legal :: View -> Bool prop_branchView_legal = Git.Ref.legal False . fromRef . branchView -- cgit v1.2.3