Skip to content

Fix potentially executing linguist with wrong version of bundle

Patrick Steinhardt requested to merge pks-linguist-execution into master

Since 489e4eac (linguist: Use configured Git executable, 2020-08-19), we modify git-linguist's PATH environment variable in order to have it use the correct Git executable. This is mostly done as git-linguist doesn't allow us to pick a Git executable, so we need prepend the real Git executable's directory to PATH.

This hack has caused a regression, though: in case the Git directory also contains bundle(1), then we now potentially use the wrong bundle version and thus also the wrong version of Ruby. As a result, execution will fail.

Fix the issue by resolving bundle to an absolute path and using that one instead.


Note that I've added no test here. It's doable, e.g. by having another binary directory which includes a symlink to the real Git as well as a bundle script which always raises a failure. But I don't think it's worth it.

Fixes #3085 (closed)

Edited by Patrick Steinhardt

Merge request reports