fix display of remote name in json
Also fixes it in the graphviz map in some cases, where there is no description for a repository. And in json, use the remote name, never the description, since the field is "remote" which is intended to be the git remote name. Sponsored-by: the NIH-funded NICEMAN (ReproNim TR&D3) project
This commit is contained in:
parent
a44638ca73
commit
2fad57de44
1 changed files with 5 additions and 3 deletions
|
@ -108,7 +108,7 @@ hostname r
|
||||||
basehostname :: Git.Repo -> String
|
basehostname :: Git.Repo -> String
|
||||||
basehostname r = fromMaybe "" $ headMaybe $ splitc '.' $ hostname r
|
basehostname r = fromMaybe "" $ headMaybe $ splitc '.' $ hostname r
|
||||||
|
|
||||||
{- A name to display for a repo. Uses the description
|
{- A description to display for a repo. Uses the description
|
||||||
- from uuid.log if available, or the remote name if not. -}
|
- from uuid.log if available, or the remote name if not. -}
|
||||||
repoName :: UUIDDescMap -> Git.Repo -> String
|
repoName :: UUIDDescMap -> Git.Repo -> String
|
||||||
repoName umap r
|
repoName umap r
|
||||||
|
@ -189,7 +189,9 @@ absRepo reference r
|
||||||
| otherwise = liftIO $ do
|
| otherwise = liftIO $ do
|
||||||
r' <- Git.Construct.fromPath =<< absPath (Git.repoPath r)
|
r' <- Git.Construct.fromPath =<< absPath (Git.repoPath r)
|
||||||
r'' <- safely $ flip Annex.eval Annex.gitRepo =<< Annex.new r'
|
r'' <- safely $ flip Annex.eval Annex.gitRepo =<< Annex.new r'
|
||||||
return (fromMaybe r' r'')
|
return $ (fromMaybe r' r'')
|
||||||
|
{ Git.remoteName = Git.remoteName r
|
||||||
|
}
|
||||||
|
|
||||||
{- Checks if two repos are the same. -}
|
{- Checks if two repos are the same. -}
|
||||||
same :: Git.Repo -> Git.Repo -> Bool
|
same :: Git.Repo -> Git.Repo -> Bool
|
||||||
|
@ -314,7 +316,7 @@ outputJSONMap rs trustmap umap =
|
||||||
]
|
]
|
||||||
|
|
||||||
mkremote r = JSON.object
|
mkremote r = JSON.object
|
||||||
[ "remote" .= packString (repoName umap r)
|
[ "remote" .= (packString <$> Git.remoteName r)
|
||||||
, "uuid" .= mkuuid (getUncachedUUID r)
|
, "uuid" .= mkuuid (getUncachedUUID r)
|
||||||
, "url" .= packString (Git.repoLocation r)
|
, "url" .= packString (Git.repoLocation r)
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue