Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
dfe7e589
Commit
dfe7e589
authored
Mar 22, 2019
by
Sander van Harmelen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for different archive formats
Fixes #587
parent
c0af6af6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
repositories.go
repositories.go
+6
-0
No files found.
repositories.go
View file @
dfe7e589
...
...
@@ -137,6 +137,7 @@ func (s *RepositoriesService) RawBlobContent(pid interface{}, sha string, option
// GitLab API docs:
// https://docs.gitlab.com/ce/api/repositories.html#get-file-archive
type
ArchiveOptions
struct
{
Format
*
string
`url:"-" json:"-"`
SHA
*
string
`url:"sha,omitempty" json:"sha,omitempty"`
}
...
...
@@ -151,6 +152,11 @@ func (s *RepositoriesService) Archive(pid interface{}, opt *ArchiveOptions, opti
}
u
:=
fmt
.
Sprintf
(
"projects/%s/repository/archive"
,
url
.
QueryEscape
(
project
))
// Set an optional format for the archive.
if
opt
!=
nil
&&
opt
.
Format
!=
nil
{
u
=
fmt
.
Sprintf
(
"%s.%s"
,
u
,
*
opt
.
Format
)
}
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
opt
,
options
)
if
err
!=
nil
{
return
nil
,
nil
,
err
...
...
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