summaryrefslogtreecommitdiffstats
path: root/script/git-daemon
diff options
context:
space:
mode:
authorJohan Sørensen <johan@johansorensen.com>2009-03-02 16:13:50 +0100
committerJohan Sørensen <johan@johansorensen.com>2009-04-22 15:15:26 +0200
commit9ad08cca0a6a659ec096358ff53197f8c97a7876 (patch)
tree630e76fa8f012ba67de899493add87c27f59c5a7 /script/git-daemon
parentfe69b96721e2cd77ce3f21c47b0cde3d7d5c2e41 (diff)
downloadgitorious-mainline-outdated-9ad08cca0a6a659ec096358ff53197f8c97a7876.zip
gitorious-mainline-outdated-9ad08cca0a6a659ec096358ff53197f8c97a7876.tar.gz
gitorious-mainline-outdated-9ad08cca0a6a659ec096358ff53197f8c97a7876.tar.bz2
Write a friendly error message when the repository couldn't be found in the git-daemon
Diffstat (limited to 'script/git-daemon')
-rwxr-xr-xscript/git-daemon14
1 files changed, 14 insertions, 0 deletions
diff --git a/script/git-daemon b/script/git-daemon
index f736770..23f8479 100755
--- a/script/git-daemon
+++ b/script/git-daemon
@@ -84,6 +84,8 @@ module Git
unless repository
log(Process.pid, "Cannot find repository: #{path}")
+ write_error_message(session, "Cannot find repository: #{base_path}")
+ $children_active -= 1
session.close
return
end
@@ -93,6 +95,7 @@ module Git
if real_path.index(BASE_PATH) != 0 || !File.directory?(real_path)
log(Process.pid, "Invalid path: #{real_path}")
+ write_error_message(session, "Cannot find repository: #{base_path}")
session.close
$children_active -= 1
return
@@ -168,6 +171,17 @@ module Git
$stderr.puts "#{Time.now.strftime("%Y-%m-%d %H:%M:%S")} [#{pid}] #{msg}"
end
+ def write_error_message(session, msg)
+ message = ["\n----------------------------------------------"]
+ message << msg
+ message << "----------------------------------------------\n"
+ write_into_sideband(session, message.join("\n"), 2)
+ end
+
+ def write_into_sideband(session, message, channel)
+
+ end
+
def accept_socket
if RUBY_VERSION < '1.9'
@socket.accept