git does not crash when there's a remote configured for a user who does
not exist, and this prevents git-annex from crashing too. Consider that
a user might exist on one system but not another, and the git repo be
moved between systems. So not crashing is desirable.
Note that git fetch seems to mishandle a remote path like ~foo/bar
when the user does not exist. While it does access ./~foo/bar,
and gets as far as running git-upload-pack on the path,
it then complains there is no such repo. So different parts of git seem
to be doing different things in that edge case. Anyway, git-annex does
not need to be bug-for-bug compatible with git.
Sponsored-by: Jack Hill on Patreon
by versions of git-annex older than 6.20180312.
* test: Put gpg temp home directory in system temp directory,
not filesystem being tested.
+ * Avoid crashing tilde expansion on user who does not exist.
-- Joey Hess <id@joeyh.name> Mon, 11 Oct 2021 14:09:13 -0400
#ifdef mingw32_HOST_OS
expandTilde = return
#else
-expandTilde = expandt True
+expandTilde p = expandt True p
+ -- If unable to expand a tilde, eg due to a user not existing,
+ -- use the path as given.
+ `catchNonAsync` (const (return p))
where
expandt _ [] = return ""
expandt _ ('/':cs) = do