Merge branch 'master' into deploy_keys
Conflicts: app/models/project.rb
This commit is contained in:
commit
f8ad4d2b42
35 changed files with 556 additions and 90 deletions
|
@ -43,14 +43,14 @@ module Gitlabhq
|
|||
|
||||
def destroy_project(project)
|
||||
FileUtils.rm_rf(project.path_to_repo)
|
||||
|
||||
|
||||
ga_repo = ::Gitolite::GitoliteAdmin.new(File.join(@local_dir,'gitolite'))
|
||||
conf = ga_repo.config
|
||||
conf.rm_repo(project.path)
|
||||
ga_repo.save
|
||||
end
|
||||
|
||||
#update or create
|
||||
#update or create
|
||||
def update_keys(user, key)
|
||||
File.open(File.join(@local_dir, 'gitolite/keydir',"#{user}.pub"), 'w') {|f| f.write(key.gsub(/\n/,'')) }
|
||||
end
|
||||
|
|
12
lib/post-receive-hook
Executable file
12
lib/post-receive-hook
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This file was placed here by Gitlab. It makes sure that your pushed commits
|
||||
# will be processed properly.
|
||||
|
||||
while read oldrev newrev ref
|
||||
do
|
||||
# For every branch or tag that was pushed, create a Resque job in redis.
|
||||
pwd=`pwd`
|
||||
reponame=`basename "$pwd" | cut -d. -f1`
|
||||
env -i redis-cli rpush "resque:queue:post-receive" "{\"class\":\"PostReceive\",\"args\":[\"$reponame\",\"$oldrev\",\"$newrev\",\"$ref\"]}" > /dev/null 2>&1
|
||||
done
|
1
lib/tasks/resque.rake
Normal file
1
lib/tasks/resque.rake
Normal file
|
@ -0,0 +1 @@
|
|||
require 'resque/tasks'
|
14
lib/utils.rb
14
lib/utils.rb
|
@ -17,15 +17,13 @@ module Utils
|
|||
end
|
||||
|
||||
module CharEncode
|
||||
def encode(string)
|
||||
return '' unless string
|
||||
cd = CharDet.detect(string)
|
||||
if cd.confidence > 0.6
|
||||
string.force_encoding(cd.encoding)
|
||||
def encode(content)
|
||||
content ||= ''
|
||||
detection = CharlockHolmes::EncodingDetector.detect(content)
|
||||
if hash = detection
|
||||
content = CharlockHolmes::Converter.convert(content, hash[:encoding], 'UTF-8') if hash[:encoding]
|
||||
end
|
||||
string.encode("utf-8", :undef => :replace, :replace => "?", :invalid => :replace)
|
||||
rescue
|
||||
"Invalid Encoding"
|
||||
content
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue