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
d299e7ef
Commit
d299e7ef
authored
Apr 03, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make force push detection actually work
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
d5adeb1f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
lib/gitlab_net.rb
lib/gitlab_net.rb
+1
-0
lib/gitlab_update.rb
lib/gitlab_update.rb
+2
-2
No files found.
lib/gitlab_net.rb
View file @
d299e7ef
...
@@ -15,6 +15,7 @@ class GitlabNet
...
@@ -15,6 +15,7 @@ class GitlabNet
action:
cmd
,
action:
cmd
,
ref:
ref
,
ref:
ref
,
project:
project_name
,
project:
project_name
,
forced_push:
forced_push
,
}
}
params
.
merge!
(
oldrev:
oldrev
)
if
oldrev
params
.
merge!
(
oldrev:
oldrev
)
if
oldrev
...
...
lib/gitlab_update.rb
View file @
d299e7ef
...
@@ -23,7 +23,7 @@ class GitlabUpdate
...
@@ -23,7 +23,7 @@ class GitlabUpdate
end
end
def
forced_push?
def
forced_push?
missed_refs
=
IO
.
popen
(
%W(git rev-list
#{
@
newrev
}
..
#{
@oldrev
}
--
)
).
read
missed_refs
=
IO
.
popen
(
%W(git rev-list
#{
@
oldrev
}
^
#{
@newrev
}
)
).
read
missed_refs
.
split
(
"
\n
"
).
size
>
0
missed_refs
.
split
(
"
\n
"
).
size
>
0
end
end
...
@@ -32,7 +32,7 @@ class GitlabUpdate
...
@@ -32,7 +32,7 @@ class GitlabUpdate
# get value from it
# get value from it
ENV
[
'GL_ID'
]
=
nil
ENV
[
'GL_ID'
]
=
nil
if
api
.
allowed?
(
'git-receive-pack'
,
@repo_name
,
@actor
,
@ref_name
,
@oldrev
,
@newrev
,
forced_push
)
if
api
.
allowed?
(
'git-receive-pack'
,
@repo_name
,
@actor
,
@ref_name
,
@oldrev
,
@newrev
,
forced_push
?
)
update_redis
update_redis
exit
0
exit
0
else
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