Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-shell
Commits
f79bb5a3
Commit
f79bb5a3
authored
Jan 28, 2014
by
Steven Thonus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first setup to protect protected branched to force updates
rebased for new code
parent
ce88b74d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
lib/gitlab_net.rb
lib/gitlab_net.rb
+1
-1
lib/gitlab_update.rb
lib/gitlab_update.rb
+6
-1
No files found.
lib/gitlab_net.rb
View file @
f79bb5a3
...
...
@@ -6,7 +6,7 @@ require_relative 'gitlab_config'
require_relative
'gitlab_logger'
class
GitlabNet
def
allowed?
(
cmd
,
repo
,
actor
,
ref
,
oldrev
=
nil
,
newrev
=
nil
)
def
allowed?
(
cmd
,
repo
,
actor
,
ref
,
oldrev
=
nil
,
newrev
=
nil
,
forced_push
=
false
)
project_name
=
repo
.
gsub
(
"'"
,
""
)
project_name
=
project_name
.
gsub
(
/\.git\Z/
,
""
)
project_name
=
project_name
.
gsub
(
/\A\//
,
""
)
...
...
lib/gitlab_update.rb
View file @
f79bb5a3
...
...
@@ -22,12 +22,17 @@ class GitlabUpdate
@newrev
=
ARGV
[
2
]
end
def
forced_push?
missed_refs
=
IO
.
popen
(
%W(git rev-list
#{
@newrev
}
..
#{
@oldrev
}
--)
).
read
missed_refs
.
split
(
"
\n
"
).
size
>
0
end
def
exec
# reset GL_ID env since we already
# get value from it
ENV
[
'GL_ID'
]
=
nil
if
api
.
allowed?
(
'git-receive-pack'
,
@repo_name
,
@actor
,
@ref_name
,
@oldrev
,
@newrev
)
if
api
.
allowed?
(
'git-receive-pack'
,
@repo_name
,
@actor
,
@ref_name
,
@oldrev
,
@newrev
,
forced_push
)
update_redis
exit
0
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment