diff options
author | Nicolas Despres <nicolas.despres@gmail.com> | 2012-11-10 00:08:30 +0100 |
---|---|---|
committer | Nicolas Despres <nicolas.despres@gmail.com> | 2012-11-10 20:39:04 +0100 |
commit | df822961eebd444b31bfad93c9b1b55d1d0ad6da (patch) | |
tree | aa2cc50177e3141b485ece4f5532522bc0d8f6ff /railties/lib/rails/test_unit | |
parent | 8ec51669d46b47027c848001d228d98ee0611f8b (diff) | |
download | rails-df822961eebd444b31bfad93c9b1b55d1d0ad6da.tar.gz rails-df822961eebd444b31bfad93c9b1b55d1d0ad6da.tar.bz2 rails-df822961eebd444b31bfad93c9b1b55d1d0ad6da.zip |
Rake test:uncommitted finds git directory in ancestors.
Sometimes your git directory is an ancestor of your application root
directory.
For example:
./repo/.git/
./repo/app/Rakefile
In this case rake test:uncommitted will be unable to detect your SCM.
This patch fixes this and add a test.
Diffstat (limited to 'railties/lib/rails/test_unit')
-rw-r--r-- | railties/lib/rails/test_unit/testing.rake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake index cd59fbe599..9ad3a4e6d6 100644 --- a/railties/lib/rails/test_unit/testing.rake +++ b/railties/lib/rails/test_unit/testing.rake @@ -88,7 +88,7 @@ namespace :test do def t.file_list if File.directory?(".svn") changed_since_checkin = silence_stderr { `svn status` }.split.map { |path| path.chomp[7 .. -1] } - elsif File.directory?(".git") + elsif system "git rev-parse --git-dir 2>&1 >/dev/null" changed_since_checkin = silence_stderr { `git ls-files --modified --others --exclude-standard` }.split.map { |path| path.chomp } else abort "Not a Subversion or Git checkout." |