aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMartin Afanasjew2016-06-13 02:51:50 +0200
committerMartin Afanasjew2016-06-19 22:12:34 +0200
commita8165b6dbd9837c0ba3c8a0fa368e80aaf5a5dd9 (patch)
treebc525b00daa79031fef6a83016e2bd41f50ba1e2 /Library
parent96cbce015e0b327bd7d30fc101cbd25452cd2fd8 (diff)
downloadbrew-a8165b6dbd9837c0ba3c8a0fa368e80aaf5a5dd9.tar.bz2
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.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/ENV/scm/git4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/ENV/scm/git b/Library/ENV/scm/git
index 1e74a175d..091b1713d 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