Lit emulates shell semantics in its RUN: line interpretation. As
part of this emulation, it sniffs 'cd' commands in the command
to execute (such as "cd /some/path && ...") and then uses the
argument to 'cd' as a directory in which it interprets subsequent
elements of the command, in particular globs.
When expanding a non-absolute (relative) glob, however, it currently
takes a naive and (I argue) incorrect approach to them: it prepends
the inferred working directory's absolute path to the glob and then
expands the glob as an absolute path. This identifies the correct
_files_ but it names them absolutely, where the glob was written
as a relative glob. In a few corner cases, the difference between
an absolute and a relative filename is _meaningful_ to the program
under test, and should be preserved even when expanding globs.
This change works by stripping the absolute prefix back off the
expansion of a relative glob (using relpath), which makes the
behaviour at least more shell-like.