aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-01 05:55:30 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-01 05:55:30 +0000
commit1d74a161eb7aa593a71d9cfb51247da125048cb3 (patch)
tree421ed59d9ff179f2a019b72c196574326f6bfd74 /configure.in
parentda9e87d69e7221d2e002c2e73ad9daa4440ef783 (diff)
downloadruby-1d74a161eb7aa593a71d9cfb51247da125048cb3.tar.gz
improve git repository detection
* configure.in (AC_CONFIG_FILES): $srcdir/.git can be a file pointing the real git_dir, such as when the git working tree is a "linked working tree" (a working tree created by git-worktree). So use git-rev-parse --git-dir to check if $srcdir is the top-level of a git repository, not just checking if the $srcdir/.git directory does exist or not. [ruby-core:74759] [Bug #12239] * tool/change_maker.rb: use tool/vcs.rb to detect VCS. This used to have its own VCS detection code, while we have tool/vcs.rb. * tool/vcs.rb (detect): remove code duplication git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in10
1 files changed, 6 insertions, 4 deletions
diff --git a/configure.in b/configure.in
index a96ed71344..b32187bee9 100644
--- a/configure.in
+++ b/configure.in
@@ -4464,10 +4464,12 @@ AC_CONFIG_FILES(Makefile, [
:
elif svn info "$srcdir" > /dev/null 2>&1; then
VCS='svn'
- elif test -d "$srcdir/.git/svn"; then
- VCS='git svn'
- elif test -d "$srcdir/.git"; then
- VCS='git'
+ elif git_dir=`git --work-tree="$srcdir" --git-dir="$srcdir/.git" rev-parse --git-dir 2>/dev/null`; then
+ if test -d "$git_dir/svn"; then
+ VCS='git svn'
+ else
+ VCS='git'
+ fi
else
VCS='echo cannot'
fi