FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit/test/nodegit.js at emscripten · schuth/nodegit · GitHub
schuth
nodegit
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit
/
test
/
nodegit.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
40 lines (36 loc) · 1.09 KB
Breadcrumbs
nodegit
/
test
/
nodegit.js
Copy path
File metadata and controls
40 lines (36 loc) · 1.09 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
var
fs
=
require
(
'fs'
)
;
var
rimraf
=
require
(
'rimraf'
)
;
var
exec
=
require
(
'child_process'
)
.
exec
;
var
path
=
require
(
'path'
)
;
var
async
=
require
(
'async'
)
;
var
testFiles
=
[
'blob'
,
'difflist'
,
'oid'
,
'repo'
,
'tree_entry'
,
'commit'
,
'reference'
,
'revwalk'
,
'tree'
]
;
function
setupReposCache
(
cb
)
{
fs
.
mkdir
(
'repos'
,
function
(
)
{
async
.
series
(
[
function
empty
(
cb
)
{
exec
(
'git init repos/empty'
,
function
(
)
{
cb
(
)
;
}
)
;
}
,
function
workdir
(
cb
)
{
exec
(
'git clone https://github.com/nodegit/nodegit.git repos/workdir'
,
function
(
)
{
cb
(
)
;
}
)
;
}
,
function
nonrepo
(
cb
)
{
fs
.
mkdir
(
'repos/nonrepo'
,
function
(
)
{
fs
.
writeFile
(
'repos/nonrepo/file.txt'
,
'This is a bogus file'
,
function
(
)
{
cb
(
)
;
}
)
;
}
)
;
}
]
,
function
(
)
{
cb
(
)
;
}
)
;
}
)
;
}
exports
.
setUp
=
function
(
cb
)
{
fs
.
exists
(
'.reposCache'
,
function
(
exists
)
{
if
(
!
exists
)
{
setupReposCache
(
function
(
err
)
{
cb
(
)
;
}
)
;
}
}
)
;
}
;
Object
.
keys
(
testFiles
)
.
forEach
(
function
(
fileName
)
{
var
testFile
=
testFiles
[
fileName
]
exports
[
testFile
]
=
require
(
'./'
+
testFile
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL