Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
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
iv
gitlab-workhorse
Commits
28c9928c
Commit
28c9928c
authored
Feb 11, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Declare params structs outside Inject functions
parent
46680f42
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
internal/git/archive.go
internal/git/archive.go
+7
-6
internal/git/blob.go
internal/git/blob.go
+2
-1
No files found.
internal/git/archive.go
View file @
28c9928c
...
@@ -21,16 +21,17 @@ import (
...
@@ -21,16 +21,17 @@ import (
)
)
type
archive
struct
{
senddata
.
Prefix
}
type
archive
struct
{
senddata
.
Prefix
}
type
archiveParams
struct
{
var
SendArchive
=
&
archive
{
"git-archive:"
}
func
(
a
*
archive
)
Inject
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
sendData
string
)
{
var
params
struct
{
RepoPath
string
RepoPath
string
ArchivePath
string
ArchivePath
string
ArchivePrefix
string
ArchivePrefix
string
CommitId
string
CommitId
string
}
}
var
SendArchive
=
&
archive
{
"git-archive:"
}
func
(
a
*
archive
)
Inject
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
sendData
string
)
{
var
params
archiveParams
if
err
:=
a
.
Unpack
(
&
params
,
sendData
);
err
!=
nil
{
if
err
:=
a
.
Unpack
(
&
params
,
sendData
);
err
!=
nil
{
helper
.
Fail500
(
w
,
fmt
.
Errorf
(
"SendArchive: unpack sendData: %v"
,
err
))
helper
.
Fail500
(
w
,
fmt
.
Errorf
(
"SendArchive: unpack sendData: %v"
,
err
))
return
return
...
...
internal/git/blob.go
View file @
28c9928c
...
@@ -10,11 +10,12 @@ import (
...
@@ -10,11 +10,12 @@ import (
)
)
type
blob
struct
{
senddata
.
Prefix
}
type
blob
struct
{
senddata
.
Prefix
}
type
blobParams
struct
{
RepoPath
,
BlobId
string
}
var
SendBlob
=
&
blob
{
"git-blob:"
}
var
SendBlob
=
&
blob
{
"git-blob:"
}
func
(
b
*
blob
)
Inject
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
sendData
string
)
{
func
(
b
*
blob
)
Inject
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
sendData
string
)
{
var
params
struct
{
RepoPath
,
BlobId
string
}
var
params
blobParams
if
err
:=
b
.
Unpack
(
&
params
,
sendData
);
err
!=
nil
{
if
err
:=
b
.
Unpack
(
&
params
,
sendData
);
err
!=
nil
{
helper
.
Fail500
(
w
,
fmt
.
Errorf
(
"SendBlob: unpack sendData: %v"
,
err
))
helper
.
Fail500
(
w
,
fmt
.
Errorf
(
"SendBlob: unpack sendData: %v"
,
err
))
return
return
...
...
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