aboutsummaryrefslogtreecommitdiff
path: root/check.cgi
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@mgm-sp.de>2015-11-19 21:35:59 +0100
committerBenjamin Kellermann <Benjamin.Kellermann@mgm-sp.de>2015-11-19 21:35:59 +0100
commit45c56db3ac731003d1fc056426584c44dd748b1c (patch)
treec0299a03b994310ade195c35d671da35953f886f /check.cgi
parentea0c4bcf4a5cb02533c5b1c6c03f827578689204 (diff)
add a check for git which caused a lot of trouble
Diffstat (limited to '')
-rwxr-xr-xcheck.cgi18
1 files changed, 18 insertions, 0 deletions
diff --git a/check.cgi b/check.cgi
index dc45f60..4a7b349 100755
--- a/check.cgi
+++ b/check.cgi
@@ -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