Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
f35cfe59
Commit
f35cfe59
authored
Jan 20, 2016
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If git-annex is enabled and it does its require branch sync, skip git_hooks.
parent
ce8d0a4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+20
-0
No files found.
lib/gitlab/git_access.rb
View file @
f35cfe59
...
...
@@ -85,6 +85,8 @@ module Gitlab
end
def
push_access_check
(
changes
)
return
build_status_object
(
true
)
if
git_annex_branch_sync?
(
changes
)
if
user
user_push_access_check
(
changes
)
elsif
deploy_key
...
...
@@ -325,5 +327,23 @@ module Gitlab
build_status_object
(
false
,
"You don't have permission"
)
end
end
def
git_annex_branch_sync?
(
changes
)
return
false
unless
Gitlab
.
config
.
gitlab_shell
.
git_annex_enabled
return
false
if
changes
.
blank?
changes
=
changes
.
lines
if
changes
.
kind_of?
(
String
)
# Iterate over all changes to find if user allowed all of them to be applied
# 0000000000000000000000000000000000000000 3073696294ddd52e9e6b6fc3f429109cac24626f refs/heads/synced/git-annex
# 0000000000000000000000000000000000000000 65be9df0e995d36977e6d76fc5801b7145ce19c9 refs/heads/synced/master
changes
.
map
(
&
:strip
).
reject
(
&
:blank?
).
each
do
|
change
|
unless
change
.
end_with?
(
"refs/heads/synced/git-annex"
)
||
change
.
include?
(
"refs/heads/synced/"
)
return
false
end
end
true
end
end
end
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