diff options
author | Benjamin Kellermann <Benjamin.Kellermann@mgm-sp.de> | 2015-11-19 21:35:59 +0100 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@mgm-sp.de> | 2015-11-19 21:35:59 +0100 |
commit | 45c56db3ac731003d1fc056426584c44dd748b1c (patch) | |
tree | c0299a03b994310ade195c35d671da35953f886f /check.cgi | |
parent | ea0c4bcf4a5cb02533c5b1c6c03f827578689204 (diff) |
add a check for git which caused a lot of trouble
Diffstat (limited to '')
-rwxr-xr-x | check.cgi | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -48,6 +48,24 @@ end unless File.writable?(".") problems << ["Your webserver needs write access to #{File.expand_path(".")}"] +else + testdir = "this-is-a-test-directory-created-by-check.cgi-it-should-be-deleted" + Dir.mkdir(testdir) + Dir.chdir(testdir) + VCS.init + teststring = "This is a test" + File.open("testfile","w") {|file| + file << teststring + } + File.symlink("../participate.rb","index.cgi") + VCS.add("testfile") + VCS.commit("Test commit") + if VCS.cat(VCS.revno, "testfile") != teststring + problems << ["git commit is not working! Please try to set the following within your .htaccess:",'SetEnv GIT_AUTHOR_NAME="http user"','SetEnv GIT_AUTHOR_EMAIL=foo@example.org','SetEnv GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"','SetEnv GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"'] + end + Dir.chdir("..") + require "fileutils" + FileUtils.rm_r(testdir) end rescue Exception => e |