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
60d7ae97
Commit
60d7ae97
authored
Oct 30, 2015
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First take on uploading lfs object.
parent
bb3566b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
githandler.go
githandler.go
+7
-1
No files found.
githandler.go
View file @
60d7ae97
...
@@ -59,8 +59,14 @@ var gitServices = [...]gitService{
...
@@ -59,8 +59,14 @@ var gitServices = [...]gitService{
gitService
{
"GET"
,
"/repository/archive.tar"
,
handleGetArchive
,
"tar"
},
gitService
{
"GET"
,
"/repository/archive.tar"
,
handleGetArchive
,
"tar"
},
gitService
{
"GET"
,
"/repository/archive.tar.gz"
,
handleGetArchive
,
"tar.gz"
},
gitService
{
"GET"
,
"/repository/archive.tar.gz"
,
handleGetArchive
,
"tar.gz"
},
gitService
{
"GET"
,
"/repository/archive.tar.bz2"
,
handleGetArchive
,
"tar.bz2"
},
gitService
{
"GET"
,
"/repository/archive.tar.bz2"
,
handleGetArchive
,
"tar.bz2"
},
gitService
{
"PUT"
,
"/gitlab-lfs/objects"
,
handleStoreLfsObject
,
"lfs-object-receive"
},
}
}
var
(
errHashMismatch
=
errors
.
New
(
"Content hash does not match OID"
)
errSizeMismatch
=
errors
.
New
(
"Content size does not match"
)
)
func
newGitHandler
(
authBackend
string
,
authTransport
http
.
RoundTripper
)
*
gitHandler
{
func
newGitHandler
(
authBackend
string
,
authTransport
http
.
RoundTripper
)
*
gitHandler
{
return
&
gitHandler
{
&
http
.
Client
{
Transport
:
authTransport
},
authBackend
}
return
&
gitHandler
{
&
http
.
Client
{
Transport
:
authTransport
},
authBackend
}
}
}
...
@@ -73,7 +79,7 @@ func (h *gitHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
...
@@ -73,7 +79,7 @@ func (h *gitHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// Look for a matching Git service
// Look for a matching Git service
foundService
:=
false
foundService
:=
false
for
_
,
g
=
range
gitServices
{
for
_
,
g
=
range
gitServices
{
if
r
.
Method
==
g
.
method
&&
strings
.
HasSuffix
(
r
.
URL
.
Path
,
g
.
suffix
)
{
if
r
.
Method
==
g
.
method
&&
strings
.
Contains
(
r
.
URL
.
Path
,
g
.
suffix
)
{
foundService
=
true
foundService
=
true
break
break
}
}
...
...
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