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
1
Merge Requests
1
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
nexedi
gitlab-workhorse
Commits
7d3fefcf
Commit
7d3fefcf
authored
Jan 15, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use 'naked return' style
parent
819a23d8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
internal/git/upload-pack.go
internal/git/upload-pack.go
+5
-5
No files found.
internal/git/upload-pack.go
View file @
7d3fefcf
...
@@ -22,7 +22,7 @@ func handleUploadPack(action string, w *GitHttpResponseWriter, r *http.Request,
...
@@ -22,7 +22,7 @@ func handleUploadPack(action string, w *GitHttpResponseWriter, r *http.Request,
_
,
err
=
io
.
Copy
(
buffer
,
io
.
LimitReader
(
r
.
Body
,
4096
))
_
,
err
=
io
.
Copy
(
buffer
,
io
.
LimitReader
(
r
.
Body
,
4096
))
if
err
!=
nil
{
if
err
!=
nil
{
helper
.
Fail500
(
w
,
r
,
&
copyError
{
fmt
.
Errorf
(
"handleUploadPack: buffer git-upload-pack body: %v"
,
err
)})
helper
.
Fail500
(
w
,
r
,
&
copyError
{
fmt
.
Errorf
(
"handleUploadPack: buffer git-upload-pack body: %v"
,
err
)})
return
return
writtenIn
,
err
}
}
isShallowClone
=
scanDeepen
(
bytes
.
NewReader
(
buffer
.
Bytes
()))
isShallowClone
=
scanDeepen
(
bytes
.
NewReader
(
buffer
.
Bytes
()))
...
@@ -33,7 +33,7 @@ func handleUploadPack(action string, w *GitHttpResponseWriter, r *http.Request,
...
@@ -33,7 +33,7 @@ func handleUploadPack(action string, w *GitHttpResponseWriter, r *http.Request,
if
err
!=
nil
{
if
err
!=
nil
{
helper
.
Fail500
(
w
,
r
,
&
copyError
{
fmt
.
Errorf
(
"handleUploadPack: full buffer git-upload-pack body: %v"
,
err
)})
helper
.
Fail500
(
w
,
r
,
&
copyError
{
fmt
.
Errorf
(
"handleUploadPack: full buffer git-upload-pack body: %v"
,
err
)})
return
return
writtenIn
,
err
}
}
body
=
ioutil
.
NopCloser
(
bytes
.
NewBuffer
(
buf
))
body
=
ioutil
.
NopCloser
(
bytes
.
NewBuffer
(
buf
))
...
@@ -42,7 +42,7 @@ func handleUploadPack(action string, w *GitHttpResponseWriter, r *http.Request,
...
@@ -42,7 +42,7 @@ func handleUploadPack(action string, w *GitHttpResponseWriter, r *http.Request,
cmd
,
stdin
,
stdout
,
err
:=
setupGitCommand
(
action
,
a
,
w
,
r
)
cmd
,
stdin
,
stdout
,
err
:=
setupGitCommand
(
action
,
a
,
w
,
r
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
writtenIn
,
err
}
}
defer
stdout
.
Close
()
defer
stdout
.
Close
()
...
@@ -68,7 +68,7 @@ func handleUploadPack(action string, w *GitHttpResponseWriter, r *http.Request,
...
@@ -68,7 +68,7 @@ func handleUploadPack(action string, w *GitHttpResponseWriter, r *http.Request,
// Write the client request body to Git's standard input
// Write the client request body to Git's standard input
if
writtenIn
,
err
=
io
.
Copy
(
stdin
,
body
);
err
!=
nil
{
if
writtenIn
,
err
=
io
.
Copy
(
stdin
,
body
);
err
!=
nil
{
helper
.
Fail500
(
w
,
r
,
fmt
.
Errorf
(
"handleUploadPack: write to %v: %v"
,
cmd
.
Args
,
err
))
helper
.
Fail500
(
w
,
r
,
fmt
.
Errorf
(
"handleUploadPack: write to %v: %v"
,
cmd
.
Args
,
err
))
return
return
writtenIn
,
err
}
}
// Signal to the Git subprocess that no more data is coming
// Signal to the Git subprocess that no more data is coming
...
@@ -82,7 +82,7 @@ func handleUploadPack(action string, w *GitHttpResponseWriter, r *http.Request,
...
@@ -82,7 +82,7 @@ func handleUploadPack(action string, w *GitHttpResponseWriter, r *http.Request,
if
err
!=
nil
&&
!
(
isExitError
(
err
)
&&
isShallowClone
)
{
if
err
!=
nil
&&
!
(
isExitError
(
err
)
&&
isShallowClone
)
{
helper
.
LogError
(
r
,
fmt
.
Errorf
(
"handleUploadPack: wait for %v: %v"
,
cmd
.
Args
,
err
))
helper
.
LogError
(
r
,
fmt
.
Errorf
(
"handleUploadPack: wait for %v: %v"
,
cmd
.
Args
,
err
))
return
return
writtenIn
,
err
}
}
return
writtenIn
,
nil
return
writtenIn
,
nil
...
...
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