avoid empty env vars when setting up clean environment

This commit is contained in:
Joey Hess 2013-12-31 14:55:55 -04:00
parent 72b592cdae
commit 5c834daf59

View file

@ -96,6 +96,7 @@ cleanEnvironment = clean <$> getEnvironment
lookup "GIT_ANNEX_STANDLONE_ENV" env
restoreorig oldenv p@(k, _v)
| k `elem` vars = case lookup ("ORIG_" ++ k) oldenv of
Nothing -> Nothing
(Just v') -> Just (k, v')
(Just v')
| not (null v') -> Just (k, v')
_ -> Nothing
| otherwise = Just p