From a8165b6dbd9837c0ba3c8a0fa368e80aaf5a5dd9 Mon Sep 17 00:00:00 2001 From: Martin Afanasjew Date: Mon, 13 Jun 2016 02:51:50 +0200 Subject: [PATCH] scm/git: allow introspecting path lookup Print path of first detected Git instead of executing it. This is hidden behind a `--homebrew=print-path` argument that is unlikely to conflict with any existing or future Git flags. --- Library/ENV/scm/git | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/ENV/scm/git b/Library/ENV/scm/git index 1e74a175dc..091b1713dd 100755 --- a/Library/ENV/scm/git +++ b/Library/ENV/scm/git @@ -23,6 +23,10 @@ def exec(*args) # prevent fork-bombs arg0 = args.first return if arg0 =~ /^#{F}/i || Pathname.new(arg0).realpath == SELF_REAL + if ARGV == %w[--homebrew=print-path] + puts arg0 + exit + end super end