refine new unused code
Fixed the laziness space leak, so it runs in 60 mb or so again. Slightly faster due to using Data.Set.difference now, although this also makes it use slightly more memory. Also added display of the refs being checked, and made unused --from also check all refs for things in the remote.
This commit is contained in:
parent
297bc648b9
commit
b4d5c10fb7
3 changed files with 52 additions and 32 deletions
9
Git.hs
9
Git.hs
|
@ -20,6 +20,7 @@ module Git (
|
|||
repoIsHttp,
|
||||
repoIsLocalBare,
|
||||
repoDescribe,
|
||||
refDescribe,
|
||||
repoLocation,
|
||||
workTree,
|
||||
workTreeFile,
|
||||
|
@ -171,6 +172,14 @@ repoDescribe Repo { location = Url url } = show url
|
|||
repoDescribe Repo { location = Dir dir } = dir
|
||||
repoDescribe Repo { location = Unknown } = "UNKNOWN"
|
||||
|
||||
{- Converts a fully qualified git ref into a user-visible version -}
|
||||
refDescribe :: String -> String
|
||||
refDescribe = remove "refs/heads/" . remove "refs/remotes/"
|
||||
where
|
||||
remove prefix s
|
||||
| prefix `isPrefixOf` s = drop (length prefix) s
|
||||
| otherwise = s
|
||||
|
||||
{- Location of the repo, either as a path or url. -}
|
||||
repoLocation :: Repo -> String
|
||||
repoLocation Repo { location = Url url } = show url
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue