FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit/lib/commit.js at v0.0.3 · 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
/
lib
/
commit.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
129 lines (103 loc) · 2.56 KB
Breadcrumbs
nodegit
/
lib
/
commit.js
Copy path
File metadata and controls
129 lines (103 loc) · 2.56 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
var
git
=
require
(
'../'
)
,
events
=
require
(
'events'
)
;
var
_Commit
=
function
(
obj
)
{
var
self
=
{
_cache
:
{
}
}
;
//if( obj instanceof git.raw.Repo ) {
// self.commit = new git.raw.Commit( obj );
//}
//else if( obj instanceof git.raw.Commit ) {
// self.commit = obj;
//}
if
(
obj
instanceof
git
.
raw
.
Commit
)
{
self
.
commit
=
obj
;
}
else
{
self
.
commit
=
new
git
.
raw
.
Commit
(
)
;
}
Object
.
defineProperty
(
self
,
'id'
,
{
get
:
function
(
)
{
var
oid
=
new
git
.
raw
.
Oid
(
)
;
self
.
commit
.
id
(
oid
)
;
return
oid
;
}
,
enumerable
:
true
}
)
;
Object
.
defineProperty
(
self
,
'sha'
,
{
get
:
function
(
)
{
var
oid
=
new
git
.
raw
.
Oid
(
)
;
self
.
commit
.
id
(
oid
)
;
return
oid
.
toString
(
40
)
;
}
,
enumerable
:
true
}
)
;
Object
.
defineProperty
(
self
,
'msg'
,
{
get
:
function
(
)
{
return
self
.
commit
.
messageShort
(
)
;
}
,
enumerable
:
true
}
)
;
Object
.
defineProperty
(
self
,
'message'
,
{
get
:
function
(
)
{
return
self
.
commit
.
message
(
)
;
}
,
enumerable
:
true
}
)
;
Object
.
defineProperty
(
self
,
'time'
,
{
get
:
function
(
)
{
return
new
Date
(
self
.
commit
.
time
(
)
*
1000
)
;
}
,
enumerable
:
true
}
)
;
Object
.
defineProperty
(
self
,
'offset'
,
{
get
:
function
(
)
{
return
self
.
commit
.
timeOffset
(
)
;
}
,
enumerable
:
true
}
)
;
Object
.
defineProperty
(
self
,
'author'
,
{
get
:
function
(
)
{
var
sig
=
new
git
.
raw
.
Sig
(
)
;
self
.
commit
.
author
(
sig
)
;
return
git
.
sig
(
sig
)
;
}
,
enumerable
:
true
}
)
;
self
.
lookup
=
function
(
repo
,
oid
,
callback
)
{
self
.
repo
=
repo
;
self
.
commit
.
lookup
(
repo
,
oid
,
function
(
)
{
var
args
=
Array
.
prototype
.
slice
.
call
(
arguments
)
;
args
[
0
]
=
git
.
util
(
)
.
error
(
args
[
0
]
)
;
callback
.
apply
(
self
,
args
.
concat
(
self
)
)
;
}
)
;
}
;
self
.
tree
=
function
(
)
{
var
tree
=
new
git
.
raw
.
Tree
(
self
.
repo
)
;
if
(
tree
.
error
)
{
return
git
.
error
(
tree
.
error
)
;
}
else
{
self
.
commit
.
tree
(
tree
)
;
}
return
git
.
tree
(
self
.
repo
,
tree
)
;
}
;
self
.
file
=
function
(
path
)
{
return
self
.
tree
(
)
.
entry
(
path
)
;
}
;
self
.
history
=
function
(
start
,
end
)
{
var
revwalk
=
git
.
revwalk
(
self
.
repo
)
,
event
=
new
events
.
EventEmitter
(
)
,
commits
=
[
]
;
revwalk
.
walk
(
self
.
id
,
function
(
err
,
index
,
commit
)
{
if
(
err
)
{
event
.
emit
(
'end'
,
commits
)
;
}
else
{
event
.
emit
(
'commit'
,
index
,
commit
)
;
commits
.
push
(
commit
)
;
}
}
)
;
return
event
;
}
;
return
self
;
}
;
exports
.
commit
=
_Commit
;
Back
|
FazBrowse Home
|
New Git URL