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
nexedi
gitlab-shell
Commits
6a267b32
Commit
6a267b32
authored
May 18, 2013
by
ash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log during failure cases of fork-project.
parent
8454d8dc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+14
-5
No files found.
lib/gitlab_projects.rb
View file @
6a267b32
...
@@ -103,15 +103,24 @@ class GitlabProjects
...
@@ -103,15 +103,24 @@ class GitlabProjects
new_namespace
=
ARGV
.
shift
new_namespace
=
ARGV
.
shift
# destination namespace must be provided
# destination namespace must be provided
return
false
unless
new_namespace
unless
new_namespace
$logger
.
error
"fork-project failed: no destination namespace provided."
return
false
end
#destination namespace must exist
#
destination namespace must exist
namespaced_path
=
File
.
join
(
repos_path
,
new_namespace
)
namespaced_path
=
File
.
join
(
repos_path
,
new_namespace
)
return
false
unless
File
.
exists?
(
namespaced_path
)
unless
File
.
exists?
(
namespaced_path
)
$logger
.
error
"fork-project failed: destination namespace <
#{
namespaced_path
}
> does not exist."
return
false
end
#a project of the same name cannot already be within the destination namespace
#
a project of the same name cannot already be within the destination namespace
full_destination_path
=
File
.
join
(
namespaced_path
,
project_name
.
split
(
'/'
)[
-
1
])
full_destination_path
=
File
.
join
(
namespaced_path
,
project_name
.
split
(
'/'
)[
-
1
])
return
false
if
File
.
exists?
(
full_destination_path
)
if
File
.
exists?
(
full_destination_path
)
$logger
.
error
"fork-project failed: destination repository <
#{
full_destination_path
}
> already exists."
return
false
end
$logger
.
info
"Forking project from <
#{
full_path
}
> to <
#{
full_destination_path
}
>."
$logger
.
info
"Forking project from <
#{
full_path
}
> to <
#{
full_destination_path
}
>."
cmd
=
"cd
#{
namespaced_path
}
&& git clone --bare
#{
full_path
}
&&
#{
create_hooks_to
(
full_destination_path
)
}
"
cmd
=
"cd
#{
namespaced_path
}
&& git clone --bare
#{
full_path
}
&&
#{
create_hooks_to
(
full_destination_path
)
}
"
...
...
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