unused: --used-refspec can now be configured to look at refs in the reflog. This provides a way to not consider old versions of files to be unused after they have reached a specified age, when the old refs in the reflog expire.

May be slow.
This commit is contained in:
Joey Hess 2015-07-07 17:13:50 -04:00
parent a51b98cdd5
commit b11d2f5a8a
7 changed files with 40 additions and 13 deletions

View file

@ -210,7 +210,7 @@ getHistorical :: RefDate -> FilePath -> Annex String
getHistorical date file =
-- This check avoids some ugly error messages when the reflog
-- is empty.
ifM (null <$> inRepo (Git.RefLog.get' [Param "-n1"] fullname))
ifM (null <$> inRepo (Git.RefLog.get' [Param "-n1"] (Just fullname)))
( error ("No reflog for " ++ fromRef fullname)
, getRef (Git.Ref.dateRef fullname date) file
)