forked from nodegit/nodegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
36 lines (30 loc) · 955 Bytes
/
index.html
File metadata and controls
36 lines (30 loc) · 955 Bytes
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
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Index</title>
</head>
<body>
<!--<script src="dist/nodegit.js"></script>-->
<script>
var Module = {
onRuntimeInitialized: function() {
var loc = allocate(intArrayFromString('some_path'), 'i8', ALLOC_STACK);
// Arbitrary amount of memory.
var repo = Module._malloc(1024)
// Initialize a repository in memory.
var err = _git_repository_init(repo, loc)
console.log(err); // 0
// Open that repository.
var err = _git_repository_open(repo, loc)
console.log(err); // 0
// Change the path.
var newloc = allocate(intArrayFromString('some_path2'), 'i8', ALLOC_STACK);
var err = _git_repository_open(repo, newloc)
console.log(err); // -3
}
};
</script>
<script src="libgit2.js"></script>
</body>
</html>