Skip to content

Commit

Permalink
Merge commit 'kim/master' into next
Browse files Browse the repository at this point in the history
Conflicts:

	lib/gitjour.rb
  • Loading branch information
astro committed Sep 30, 2008
2 parents b470735 + 96f2553 commit 1932b8b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/gitjour.rb
Expand Up @@ -39,7 +39,7 @@ def list
end

def clone(repository_name, *rest)
dir = rest.shift || repository_name
dir = (rest.shift || repository_name).split(":").last
if File.exists?(dir)
exit_with! "ERROR: Clone directory '#{dir}' already exists."
end
Expand Down Expand Up @@ -72,21 +72,30 @@ def serve(path=Dir.pwd, *rest)
else
prefix = `git config --get gitjour.prefix`.chomp
prefix = ENV["USER"] if prefix.empty?
name = [prefix, name].compact.join("-")
name = [prefix, name].compact.join(":")
end

git_deamon_options = [
"--verbose",
"--port=#{port}",
"--base-path=#{File.dirname(path)}",
"--export-all",
"--base-path-relaxed"
]
if File.exists?("#{path}/.git")
announce_repo(path, name, port.to_i)
git_deamon_options << path
else
Dir["#{path}/*"].each do |dir|
if File.directory?(dir)
name = File.basename(dir)
announce_repo(dir, name, 9418)
git_deamon_options << path
end
end
end

`git daemon --verbose --export-all --port=#{port} --base-path=#{path} --base-path-relaxed`
`git daemon #{git_deamon_options.join(' ')}`
end

def help
Expand Down

0 comments on commit 1932b8b

Please sign in to comment.