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
378d406e
Unverified
Commit
378d406e
authored
May 23, 2019
by
Brandon WELSCH
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added custom writer to Archive
parent
dbe6fb3e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
repositories.go
repositories.go
+9
-1
No files found.
repositories.go
View file @
378d406e
...
...
@@ -19,6 +19,7 @@ package gitlab
import
(
"bytes"
"fmt"
"io"
)
// RepositoriesService handles communication with the repositories related
...
...
@@ -138,6 +139,7 @@ func (s *RepositoriesService) RawBlobContent(pid interface{}, sha string, option
type
ArchiveOptions
struct
{
Format
*
string
`url:"-" json:"-"`
SHA
*
string
`url:"sha,omitempty" json:"sha,omitempty"`
Writer
*
io
.
Writer
`url:"-" json:"-"`
}
// Archive gets an archive of the repository.
...
...
@@ -162,7 +164,13 @@ func (s *RepositoriesService) Archive(pid interface{}, opt *ArchiveOptions, opti
}
var
b
bytes
.
Buffer
resp
,
err
:=
s
.
client
.
Do
(
req
,
&
b
)
var
resp
*
Response
if
opt
!=
nil
&&
opt
.
Writer
!=
nil
{
resp
,
err
=
s
.
client
.
Do
(
req
,
opt
.
Writer
)
}
else
{
resp
,
err
=
s
.
client
.
Do
(
req
,
&
b
)
}
if
err
!=
nil
{
return
nil
,
resp
,
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