BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
a51f26e5
Commit
a51f26e5
authored
Dec 08, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use commit_file for commit_dir
parent
fff3c526
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
14 deletions
+24
-14
repository.rb
app/models/repository.rb
+24
-14
No files found.
app/models/repository.rb
View file @
a51f26e5
...
...
@@ -749,22 +749,32 @@ class Repository
user
,
path
,
message
,
branch
,
author_email:
nil
,
author_name:
nil
,
source_branch:
nil
,
source_project:
project
)
GitOperationService
.
new
(
user
,
self
).
with_branch
(
if
branch_exists?
(
branch
)
# tree_entry is private
entry
=
raw_repository
.
send
(
:tree_entry
,
commit
(
branch
),
path
)
if
entry
if
entry
[
:type
]
==
:blob
raise
Gitlab
::
Git
::
Repository
::
InvalidBlobName
.
new
(
"Directory already exists as a file"
)
else
raise
Gitlab
::
Git
::
Repository
::
InvalidBlobName
.
new
(
"Directory already exists"
)
end
end
end
commit_file
(
user
,
"
#{
Gitlab
::
Git
::
PathHelper
.
normalize_path
(
path
)
}
/.gitkeep"
,
''
,
message
,
branch
,
false
,
author_email:
author_email
,
author_name:
author_name
,
source_branch:
source_branch
,
source_project:
source_project
)
do
|
ref
|
options
=
{
commit:
{
branch:
ref
,
message:
message
,
update_ref:
false
}
}
options
.
merge!
(
get_committer_and_author
(
user
,
email:
author_email
,
name:
author_name
))
raw_repository
.
mkdir
(
path
,
options
)
end
source_project:
source_project
)
end
# rubocop:enable Metrics/ParameterLists
...
...
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