Subject: $PATH pollution and t9902-completion.sh

From: Adam Spiers <[email-masked]>
Date: Mon, 17 Dec 2012 01:05:38 +0000

t/t9902-completion.sh is currently failing for me because I happen to
have a custom shell-script called git-check-email in ~/bin, which is
on my $PATH.  This is different to a similar-looking case reported
recently, which was due to an unclean working tree:

  http://thread.gmane.org/gmane.comp.version-control.git/208085

It's not unthinkable that in the future other tests could break for
similar reasons.  Therefore it would be good to sanitize $PATH in the
test framework so that it cannot destabilize tests, although I am
struggling to think of a good way of doing this.  Naively stripping
directories under $HOME would not protect against git "plugins" such
as the above being installed into places like /usr/bin.  Thoughts?