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
83525e7f
Commit
83525e7f
authored
Aug 01, 2015
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factor out the checkoutDir
parent
6b1ea3dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
main_test.go
main_test.go
+4
-4
No files found.
main_test.go
View file @
83525e7f
...
...
@@ -21,6 +21,7 @@ const testRepoRoot = "test/data"
const
testRepo
=
"test.git"
var
remote
=
fmt
.
Sprintf
(
"http://%s/%s"
,
servAddr
,
testRepo
)
var
checkoutDir
=
path
.
Join
(
scratchDir
,
"test"
)
func
TestAllowedClone
(
t
*
testing
.
T
)
{
// Prepare clone directory
...
...
@@ -41,12 +42,12 @@ func TestAllowedClone(t *testing.T) {
}
// Do the git clone
cloneCmd
:=
exec
.
Command
(
"git"
,
"clone"
,
remote
,
path
.
Join
(
scratchDir
,
"test"
)
)
cloneCmd
:=
exec
.
Command
(
"git"
,
"clone"
,
remote
,
checkoutDir
)
runOrFail
(
t
,
cloneCmd
)
// We may have cloned an 'empty' repository, 'git show' will fail in it
showCmd
:=
exec
.
Command
(
"git"
,
"show"
)
showCmd
.
Dir
=
path
.
Join
(
scratchDir
,
"test"
)
showCmd
.
Dir
=
checkoutDir
runOrFail
(
t
,
showCmd
)
}
...
...
@@ -69,7 +70,7 @@ func TestDeniedClone(t *testing.T) {
}
// Do the git clone
cloneCmd
:=
exec
.
Command
(
"git"
,
"clone"
,
remote
,
path
.
Join
(
scratchDir
,
"test"
)
)
cloneCmd
:=
exec
.
Command
(
"git"
,
"clone"
,
remote
,
checkoutDir
)
if
err
:=
cloneCmd
.
Run
();
err
==
nil
{
t
.
Fatal
(
"git clone should have failed"
)
}
...
...
@@ -77,7 +78,6 @@ func TestDeniedClone(t *testing.T) {
func
TestAllowedPush
(
t
*
testing
.
T
)
{
// Prepare the repo to push from
checkoutDir
:=
path
.
Join
(
scratchDir
,
"test"
)
if
err
:=
os
.
RemoveAll
(
scratchDir
);
err
!=
nil
{
t
.
Fatal
(
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