FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit/test/runner.js at v0.6.2 · nodegit/nodegit · GitHub
nodegit
nodegit
Repository navigation
Code
Issues
344
(344)
Pull requests
21
(21)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit
/
test
/
runner.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
73 lines (67 loc) · 1.89 KB
Breadcrumbs
nodegit
/
test
/
runner.js
Copy path
File metadata and controls
73 lines (67 loc) · 1.89 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
var
promisify
=
require
(
"promisify-node"
)
;
var
fse
=
promisify
(
"fs-extra"
)
;
var
path
=
require
(
"path"
)
;
var
local
=
path
.
join
.
bind
(
path
,
__dirname
)
;
// Have to wrap exec, since it has a weird callback signature.
var
exec
=
promisify
(
function
(
command
,
opts
,
callback
)
{
return
require
(
"child_process"
)
.
exec
(
command
,
opts
,
callback
)
;
}
)
;
var
workdirPath
=
local
(
"repos/workdir"
)
;
before
(
function
(
)
{
this
.
timeout
(
350000
)
;
var
url
=
"https://github.com/nodegit/test"
;
return
fse
.
remove
(
local
(
"repos"
)
)
.
then
(
function
(
)
{
fse
.
remove
(
local
(
"home"
)
)
}
)
.
then
(
function
(
)
{
fse
.
mkdir
(
local
(
"repos"
)
)
;
}
)
.
then
(
function
(
)
{
return
exec
(
"git init "
+
local
(
"repos"
,
"empty"
)
)
;
}
)
.
then
(
function
(
)
{
return
exec
(
"git clone "
+
url
+
" "
+
workdirPath
)
;
}
)
.
then
(
function
(
)
{
return
exec
(
"git checkout rev-walk"
,
{
cwd
:
workdirPath
}
)
;
}
)
.
then
(
function
(
)
{
return
exec
(
"git checkout checkout-test"
,
{
cwd
:
workdirPath
}
)
;
}
)
.
then
(
function
(
)
{
return
exec
(
"git checkout master"
,
{
cwd
:
workdirPath
}
)
;
}
)
.
then
(
function
(
)
{
return
fse
.
mkdir
(
local
(
"repos"
,
"nonrepo"
)
)
;
}
)
.
then
(
function
(
)
{
return
fse
.
writeFile
(
local
(
"repos"
,
"nonrepo"
,
"file.txt"
)
,
"This is a bogus file"
)
;
}
)
.
then
(
function
(
)
{
return
fse
.
mkdir
(
local
(
"home"
)
)
;
}
)
.
then
(
function
(
)
{
return
fse
.
writeFile
(
local
(
"home"
,
".gitconfig"
)
,
"[user]\n name = John Doe\n email = johndoe@example.com"
)
;
}
)
;
}
)
;
beforeEach
(
function
(
)
{
this
.
timeout
(
4000
)
;
return
exec
(
"git clean -xdf"
,
{
cwd
:
workdirPath
}
)
.
then
(
function
(
)
{
return
exec
(
"git checkout master"
,
{
cwd
:
workdirPath
}
)
;
}
)
.
then
(
function
(
)
{
return
exec
(
"git reset --hard"
,
{
cwd
:
workdirPath
}
)
;
}
)
;
}
)
;
afterEach
(
function
(
done
)
{
process
.
nextTick
(
function
(
)
{
if
(
global
.
gc
)
{
global
.
gc
(
)
;
}
done
(
)
;
}
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL