move unspecifiedAttr check to checkAttr
It just so happens that everywhere that checks attrs other than annex.largefiles parses the value further, and failed to parse unspecifiedAttr in a way that behaved the same as if nothing was set. So this is not a bug fix or behavior change. What it does so is prevent future uses of checkAttr from needing to remember to handle checking for this edge case. Sponsored-by: Dartmouth College's DANDI project
This commit is contained in:
parent
38153ad340
commit
ae98fb1b31
2 changed files with 6 additions and 4 deletions
|
@ -29,8 +29,11 @@ annexAttrs =
|
|||
]
|
||||
|
||||
checkAttr :: Git.Attr -> RawFilePath -> Annex String
|
||||
checkAttr attr file = withCheckAttrHandle $ \h ->
|
||||
liftIO $ Git.checkAttr h attr file
|
||||
checkAttr attr file = withCheckAttrHandle $ \h -> do
|
||||
r <- liftIO $ Git.checkAttr h attr file
|
||||
if r == Git.unspecifiedAttr
|
||||
then return ""
|
||||
else return r
|
||||
|
||||
checkAttrs :: [Git.Attr] -> RawFilePath -> Annex [String]
|
||||
checkAttrs attrs file = withCheckAttrHandle $ \h ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue