Skip to content

Commit 592d1fa

Browse files
committed
Revert "Escape strings"
This reverts commit ce75f46.
1 parent 482a39a commit 592d1fa

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

lib/gitlab/backend/shell.rb

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
require "shellwords"
2-
31
module Gitlab
42
class Shell
53
class AccessDenied < StandardError; end
@@ -12,7 +10,7 @@ class AccessDenied < StandardError; end
1210
# add_repository("gitlab/gitlab-ci")
1311
#
1412
def add_repository(name)
15-
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "add-project", Shellwords.shellwords("#{name}.git")
13+
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "add-project", "#{name}.git"
1614
end
1715

1816
# Import repository
@@ -23,7 +21,7 @@ def add_repository(name)
2321
# import_repository("gitlab/gitlab-ci", "https://github.com/randx/six.git")
2422
#
2523
def import_repository(name, url)
26-
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "import-project", Shellwords.shellwords("#{name}.git"), Shellwords.shellwords(url)
24+
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "import-project", "#{name}.git", url
2725
end
2826

2927
# Move repository
@@ -35,7 +33,7 @@ def import_repository(name, url)
3533
# mv_repository("gitlab/gitlab-ci", "randx/gitlab-ci-new.git")
3634
#
3735
def mv_repository(path, new_path)
38-
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "mv-project", Shellwords.shellwords("#{path}.git"), Shellwords.shellwords("#{new_path}.git")
36+
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "mv-project", "#{path}.git", "#{new_path}.git"
3937
end
4038

4139
# Update HEAD for repository
@@ -47,7 +45,7 @@ def mv_repository(path, new_path)
4745
# update_repository_head("gitlab/gitlab-ci", "3-1-stable")
4846
#
4947
def update_repository_head(path, branch)
50-
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "update-head", Shellwords.shellwords("#{path}.git"), Shellwords.shellwords(branch)
48+
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "update-head", "#{path}.git", branch
5149
end
5250

5351
# Fork repository to new namespace
@@ -59,7 +57,7 @@ def update_repository_head(path, branch)
5957
# fork_repository("gitlab/gitlab-ci", "randx")
6058
#
6159
def fork_repository(path, fork_namespace)
62-
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "fork-project", Shellwords.shellwords("#{path}.git"), Shellwords.shellwords(fork_namespace)
60+
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "fork-project", "#{path}.git", fork_namespace
6361
end
6462

6563
# Remove repository from file system
@@ -70,7 +68,7 @@ def fork_repository(path, fork_namespace)
7068
# remove_repository("gitlab/gitlab-ci")
7169
#
7270
def remove_repository(name)
73-
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "rm-project", Shellwords.shellwords("#{name}.git")
71+
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "rm-project", "#{name}.git"
7472
end
7573

7674
# Add repository branch from passed ref
@@ -83,7 +81,7 @@ def remove_repository(name)
8381
# add_branch("gitlab/gitlab-ci", "4-0-stable", "master")
8482
#
8583
def add_branch(path, branch_name, ref)
86-
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "create-branch", Shellwords.shellwords("#{path}.git"), Shellwords.shellwords(branch_name), Shellwords.shellwords(ref)
84+
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "create-branch", "#{path}.git", branch_name, ref
8785
end
8886

8987
# Remove repository branch
@@ -95,7 +93,7 @@ def add_branch(path, branch_name, ref)
9593
# rm_branch("gitlab/gitlab-ci", "4-0-stable")
9694
#
9795
def rm_branch(path, branch_name)
98-
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "rm-branch", Shellwords.shellwords("#{path}.git"), Shellwords.shellwords(branch_name)
96+
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "rm-branch", "#{path}.git", branch_name
9997
end
10098

10199
# Add repository tag from passed ref
@@ -108,7 +106,7 @@ def rm_branch(path, branch_name)
108106
# add_tag("gitlab/gitlab-ci", "v4.0", "master")
109107
#
110108
def add_tag(path, tag_name, ref)
111-
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "create-tag", Shellwords.shellwords("#{path}.git"), Shellwords.shellwords(tag_name), Shellwords.shellwords(ref)
109+
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "create-tag", "#{path}.git", tag_name, ref
112110
end
113111

114112
# Remove repository tag
@@ -120,7 +118,7 @@ def add_tag(path, tag_name, ref)
120118
# rm_tag("gitlab/gitlab-ci", "v4.0")
121119
#
122120
def rm_tag(path, tag_name)
123-
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "rm-tag", Shellwords.shellwords("#{path}.git"), Shellwords.shellwords(tag_name)
121+
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-projects", "rm-tag", "#{path}.git", tag_name
124122
end
125123

126124
# Add new key to gitlab-shell
@@ -129,7 +127,7 @@ def rm_tag(path, tag_name)
129127
# add_key("key-42", "sha-rsa ...")
130128
#
131129
def add_key(key_id, key_content)
132-
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-keys", "add-key", Shellwords.shellwords(key_id), Shellwords.shellwords(key_content)
130+
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-keys", "add-key", key_id, key_content
133131
end
134132

135133
# Remove ssh key from gitlab shell
@@ -138,7 +136,7 @@ def add_key(key_id, key_content)
138136
# remove_key("key-342", "sha-rsa ...")
139137
#
140138
def remove_key(key_id, key_content)
141-
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-keys", "rm-key", Shellwords.shellwords(key_id), Shellwords.shellwords(key_content)
139+
system "#{gitlab_shell_user_home}/gitlab-shell/bin/gitlab-keys", "rm-key", key_id, key_content
142140
end
143141

144142
# Remove all ssh keys from gitlab shell

0 commit comments

Comments
 (0)