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
db77a612
Commit
db77a612
authored
Feb 16, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add config option to disable git-annex
parent
487b1bf2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
config.yml.example
config.yml.example
+5
-0
lib/gitlab_config.rb
lib/gitlab_config.rb
+4
-0
lib/gitlab_shell.rb
lib/gitlab_shell.rb
+4
-4
No files found.
config.yml.example
View file @
db77a612
...
...
@@ -46,3 +46,8 @@ log_level: INFO
# Set to true to see real usernames in the logs instead of key ids, which is easier to follow, but
# incurs an extra API call on every gitlab-shell command.
audit_usernames: false
# Enable git-annex support
# git-annex allows managing files with git, without checking the file contents into git
# See https://git-annex.branchable.com/ for documentation
git_annex_enabled: true
lib/gitlab_config.rb
View file @
db77a612
...
...
@@ -47,6 +47,10 @@ class GitlabConfig
@config
[
'audit_usernames'
]
||=
false
end
def
git_annex_enabled?
@config
[
'git_annex_enabled'
]
||=
true
end
# Build redis command to write update event in gitlab queue
def
redis_command
if
redis
.
empty?
...
...
lib/gitlab_shell.rb
View file @
db77a612
...
...
@@ -50,11 +50,11 @@ class GitlabShell
args
=
Shellwords
.
shellwords
(
@origin_cmd
)
@git_cmd
=
args
.
first
if
@git_cmd
==
'git-annex-shell'
if
@git_cmd
==
'git-annex-shell'
&&
@config
.
git_annex_enabled?
@repo_name
=
escape_path
(
args
[
2
].
gsub
(
"
\/
~
\/
"
,
''
))
# Make sure repository has git-annex enabled
enable
_git_annex
(
@repo_name
)
init
_git_annex
(
@repo_name
)
else
raise
DisallowedCommandError
unless
args
.
count
==
2
@repo_name
=
escape_path
(
args
.
last
)
...
...
@@ -68,7 +68,7 @@ class GitlabShell
def
process_cmd
repo_full_path
=
File
.
join
(
repos_path
,
repo_name
)
if
@git_cmd
==
'git-annex-shell'
if
@git_cmd
==
'git-annex-shell'
&&
@config
.
git_annex_enabled?
args
=
Shellwords
.
shellwords
(
@origin_cmd
)
parsed_args
=
args
.
map
do
|
arg
|
...
...
@@ -127,7 +127,7 @@ class GitlabShell
end
end
def
enable
_git_annex
(
path
)
def
init
_git_annex
(
path
)
full_repo_path
=
File
.
join
(
repos_path
,
path
)
unless
File
.
exists?
(
File
.
join
(
full_repo_path
,
'.git'
,
'annex'
))
...
...
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