There was a ton of duplication which is not maintainable, so refactor
everything into a single test which still covers the differences.
This in turn revealed some issues in the unstowing logic:
- We shouldn't conflict if we find a file which isn't a link or a
directory; we can just skip over it.
- Unstowing with `--dotfiles` was using the wrong variable to obtain
the package path, and as a result having to perform an unnecessary
call to `adjust_dotfile()`.
So fix those at the same time.
Placing a .stow file in a directory tells Stow that this directory
should be considered a Stow directory. This is already
well-documented.
There was an undocumented and slightly broken feature where placing a
.nonstow file in a directory was treated in exactly the same way. The
intention was for .nonstow to cause Stow to skip stowing into and
unstowing from that directory and any of its descendants. However, it
also caused Stow to consider symlinks into any of those directories as
owned by Stow, even though that was clearly not the intention. So
separate treatment of .stow and .nonstow markers, so that while both
provide protection against Stow stowing and unstowing, only .stow
affects the symlink ownership logic in find_stowed_path() and
marked_stow_dir().
Probably no one uses the undocumented .nonstow feature, so it may make
sense to remove this in future.
This is more in keeping with the UNIX convention of no output on success,
and is also the way Stow v1.x behaved. Thanks to Adam Sampson for the suggestion.