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
06b17ba8
Commit
06b17ba8
authored
Mar 18, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check git-annex message fix and updated spec
parent
04c690e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
+5
-7
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+4
-5
spec/lib/gitlab/git_access_spec.rb
spec/lib/gitlab/git_access_spec.rb
+1
-2
No files found.
lib/gitlab/git_access.rb
View file @
06b17ba8
...
...
@@ -213,7 +213,7 @@ module Gitlab
end
commits
.
each
do
|
commit
|
next
if
commit_from_annex_sync?
(
commit
.
id
,
ref
)
next
if
commit_from_annex_sync?
(
commit
.
safe_message
)
if
status_object
=
check_commit
(
commit
,
git_hook
)
return
status_object
...
...
@@ -367,12 +367,11 @@ module Gitlab
true
end
def
commit_from_annex_sync?
(
rev
,
ref
)
def
commit_from_annex_sync?
(
commit_message
)
return
false
unless
Gitlab
.
config
.
gitlab_shell
.
git_annex_enabled
# Commit present in synced/current_branch, so avoid checking git hooks on this
branch_name
=
"synced/
#{
Gitlab
::
Git
::
Ref
.
extract_branch_name
(
ref
)
}
"
project
.
repository
.
branch_names_contains
(
rev
).
include?
branch_name
# Commit message starting with <git-annex in > so avoid git hooks on this
commit_message
.
start_with?
(
'git-annex in'
)
end
end
end
spec/lib/gitlab/git_access_spec.rb
View file @
06b17ba8
...
...
@@ -327,8 +327,7 @@ describe Gitlab::GitAccess, lib: true do
describe
'git annex enabled, push to master branch'
do
before
do
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:git_annex_enabled
).
and_return
(
true
)
create
(
:ci_commit
,
project:
project
,
sha:
'570e7b2abdd848b95f2f578043fc23bd6f6fd24d'
,
ref:
'refs/heads/master'
)
project
.
repository
.
add_branch
(
user
,
'synced/master'
,
'570e7b2abdd848b95f2f578043fc23bd6f6fd24d'
)
allow_any_instance_of
(
Commit
).
to
receive
(
:safe_message
)
{
'git-annex in me@host:~/repo'
}
end
it
{
expect
(
access
.
push_access_check
(
git_annex_master_changes
)).
to
be_allowed
}
...
...
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