summaryrefslogtreecommitdiff
path: root/Command/Unused.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-07-07 17:31:30 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-07-07 17:36:30 -0400
commitb68b110dda6db2917a418b24ce7372aca6307fd1 (patch)
tree1c210a9738a23bff3b25a72fd8a7c738215446a8 /Command/Unused.hs
parent1acc9824905411220c0fa1921ab2456a52e6b491 (diff)
Only look at reflogs for relevant branches, not for git-annex branches
This speeds it up quite a bit.. May still be too slow in large repos.
Diffstat (limited to 'Command/Unused.hs')
-rw-r--r--Command/Unused.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Command/Unused.hs b/Command/Unused.hs
index 647fd6762..77a9a92c3 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -219,7 +219,7 @@ withKeysReferencedInGit refspec a = do
shaHead <- maybe (return Nothing) (inRepo . Git.Ref.sha) current
rs <- relevantrefs (shaHead, current)
<$> inRepo (Git.Command.pipeReadStrict [Param "show-ref"])
- usedrefs <- applyRefSpec refspec rs (inRepo Git.RefLog.getAll)
+ usedrefs <- applyRefSpec refspec rs (getreflog rs)
forM_ usedrefs $
withKeysReferencedInGitRef a
where
@@ -242,6 +242,7 @@ withKeysReferencedInGit refspec a = do
Git.Ref.headRef
: nubRefs (filter ((/= x) . fst) refs)
_ -> nubRefs refs
+ getreflog rs = inRepo $ Git.RefLog.getMulti rs
{- Runs an action on keys referenced in the given Git reference which
- differ from those referenced in the work tree. -}