@@ -1404,7 +1404,7 @@ def gem_test_pack
1404
1404
# Unset variable set by the pre-commit hook which confuses git
1405
1405
env = { 'GIT_DIR' => nil , 'GIT_INDEX_FILE' => nil }
1406
1406
1407
- current = raw_sh ( env , 'git' , '-C' , gem_test_pack , 'rev-parse' , 'HEAD' , capture : :out ) . chomp
1407
+ current = raw_sh ( env , 'git' , '-C' , gem_test_pack , 'rev-parse' , 'HEAD' , capture : :out , no_print_cmd : true ) . chomp
1408
1408
unless current == TRUFFLERUBY_GEM_TEST_PACK_VERSION
1409
1409
has_commit = raw_sh env , 'git' , '-C' , gem_test_pack , 'cat-file' , '-e' , TRUFFLERUBY_GEM_TEST_PACK_VERSION , continue_on_failure : true
1410
1410
unless has_commit
@@ -1841,7 +1841,7 @@ def install(name, *options)
1841
1841
dir_pattern = "#{ dir } /openjdk1.8.0*#{ jvmci_version } "
1842
1842
if Dir [ dir_pattern ] . empty?
1843
1843
STDERR . puts download_message
1844
- jvmci_releases = 'https://github.com/graalvm/openjdk8 -jvmci-builder /releases/download'
1844
+ jvmci_releases = 'https://github.com/graalvm/graal -jvmci-8 /releases/download'
1845
1845
filename = "openjdk-8u#{ update } -#{ jvmci_version } -#{ mx_os } -amd64.tar.gz"
1846
1846
chdir ( dir ) do
1847
1847
raw_sh 'curl' , '-L' , "#{ jvmci_releases } /#{ jvmci_version } /#{ filename } " , '-o' , filename
@@ -1879,6 +1879,8 @@ def install(name, *options)
1879
1879
1880
1880
eclipse_tar = eclipse_url . split ( '/' ) . last
1881
1881
eclipse_name = File . basename ( eclipse_tar , '.tar.gz' )
1882
+ eclipse_path = File . expand_path ( "../#{ eclipse_name } /#{ eclipse_exe } " , TRUFFLERUBY_DIR )
1883
+ return eclipse_path if File . exist? ( eclipse_path )
1882
1884
1883
1885
dir = File . expand_path ( '..' , TRUFFLERUBY_DIR )
1884
1886
chdir ( dir ) do
@@ -1896,7 +1898,7 @@ def install(name, *options)
1896
1898
end
1897
1899
end
1898
1900
1899
- File . expand_path ( "../ #{ eclipse_name } / #{ eclipse_exe } " , TRUFFLERUBY_DIR )
1901
+ eclipse_path
1900
1902
end
1901
1903
1902
1904
def clone_enterprise
@@ -2078,11 +2080,7 @@ def rubocop(*args)
2078
2080
2079
2081
if gem_test_pack?
2080
2082
gem_home = "#{ gem_test_pack } /rubocop-gems"
2081
- env = {
2082
- 'GEM_HOME' => gem_home ,
2083
- 'GEM_PATH' => gem_home ,
2084
- 'PATH' => "#{ gem_home } /bin:#{ ENV [ 'PATH' ] } "
2085
- }
2083
+ env = { 'GEM_HOME' => gem_home , 'GEM_PATH' => gem_home }
2086
2084
sh env , 'ruby' , "#{ gem_home } /bin/rubocop" , *args
2087
2085
else
2088
2086
sh 'rubocop' , '_0.66.0_' , *args
@@ -2381,8 +2379,18 @@ def format_specializations_arguments
2381
2379
2382
2380
def lint ( *args )
2383
2381
fast = args . first == 'fast'
2384
- fast_exts_changed = fast ? `git diff --cached --name-only` . lines . map { |f | File . extname ( f . strip ) } . uniq : [ ]
2385
- changed = -> ( ext ) { !fast or fast_exts_changed . include? ( ext ) }
2382
+ if fast
2383
+ changed_files = `git diff --cached --name-only` # Only staged files in the git index
2384
+ if changed_files . empty? # post-commit hook
2385
+ changed_files = `git diff --cached --name-only HEAD^`
2386
+ end
2387
+ raise 'Could not list changed files' if changed_files . empty?
2388
+ exts_changed = changed_files . lines . map { |f | File . extname ( f . strip ) } . uniq
2389
+ raise 'Could not list changed file extensions' if exts_changed . empty?
2390
+ changed = -> ext { exts_changed . include? ( ext ) }
2391
+ else
2392
+ changed = -> _ext { true }
2393
+ end
2386
2394
2387
2395
ENV [ 'ECLIPSE_EXE' ] ||= install_eclipse
2388
2396
0 commit comments