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
a00c534c
Commit
a00c534c
authored
Oct 02, 2013
by
Izaak Alpert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bug where the tgz returned got encoded utf8
Conflicts: doc/api/repositories.md Change-Id: I7ebc39b47ff860813d9622ba6776583536e6e384
parent
ce21d868
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
repositories.md
doc/api/repositories.md
+2
-1
repositories.rb
lib/api/repositories.rb
+9
-5
No files found.
doc/api/repositories.md
View file @
a00c534c
...
...
@@ -368,4 +368,4 @@ GET /projects/:id/repository/archive
Parameters:
+
`id`
(required) - The ID of a project
+
`sha`
(optional) - The commit
or branch name
+
`sha`
(optional) - The commit
sha to download defaults to the tip of the default branch
\ No newline at end of file
lib/api/repositories.rb
View file @
a00c534c
...
...
@@ -181,7 +181,7 @@ module API
#
# Parameters:
# id (required) - The ID of a project
# sha (optional) - the commit sha to download defaults to
head
# sha (optional) - the commit sha to download defaults to
the tip of the default branch
# Example Request:
# GET /projects/:id/repository/archive
get
":id/repository/archive"
do
...
...
@@ -190,11 +190,15 @@ module API
ref
=
params
[
:sha
]
storage_path
=
Rails
.
root
.
join
(
"tmp"
,
"repositories"
)
file_path
=
repo
.
archive_repo
(
ref
||
'HEAD'
,
storage_path
)
if
file_path
data
=
File
.
open
(
file_path
).
read
file_path
=
repo
.
archive_repo
(
ref
,
storage_path
)
if
file_path
&&
File
.
exists?
(
file_path
)
data
=
File
.
open
(
file_path
,
'rb'
).
read
header
"Content-Disposition:"
,
" infile; filename=
\"
#{
File
.
basename
(
file_path
)
}
\"
"
content_type
'application/x-gzip'
header
"Content-Disposition:"
,
" infile; filename=
\"
#{
File
.
basename
(
file_path
)
}
\"
"
env
[
'api.format'
]
=
:binary
present
data
else
not_found!
...
...
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