fork存在的时候则不重复fork

This commit is contained in:
daiao 2017-03-24 17:37:00 +08:00
parent e198979738
commit f2e337fb12
1 changed files with 6 additions and 1 deletions

View File

@ -35,7 +35,12 @@ class ShixunsController < ApplicationController
s = Trustie::Gitlab::Sync.new s = Trustie::Gitlab::Sync.new
s.sync_user(User.current) s.sync_user(User.current)
end end
gshixun = g.fork(@shixun.gpid, User.current.gid) if @shixun.gpid
gshixun = g.project(@shixun.gpid)
else
gshixun = g.fork(@shixun.gpid, User.current.gid)
end
if gshixun.id if gshixun.id
myshixun = copy_myshixun(@shixun, gshixun) myshixun = copy_myshixun(@shixun, gshixun)
challenges = @shixun.challenges challenges = @shixun.challenges