FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit/lib/reference.js at master · codercatdev/nodegit · GitHub
codercatdev
nodegit
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit
/
lib
/
reference.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
65 lines (57 loc) · 1.48 KB
Breadcrumbs
nodegit
/
lib
/
reference.js
Copy path
File metadata and controls
65 lines (57 loc) · 1.48 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
var
NodeGit
=
require
(
"../"
)
;
var
LookupWrapper
=
NodeGit
.
Utils
.
lookupWrapper
;
var
Reference
=
NodeGit
.
Reference
;
var
Branch
=
NodeGit
.
Branch
;
/**
* Retrieves the reference by it's short name
*
@async
*
@param
{
Repository
} repo The repo that the reference lives in
*
@param
{
String|Reference
} id The reference to lookup
*
@param
{
Function
} callback
*
@return
{
Reference
}
*/
Reference
.
dwim
=
LookupWrapper
(
Reference
,
Reference
.
dwim
)
;
/**
* Retrieves the reference pointed to by the oid
*
@async
*
@param
{
Repository
} repo The repo that the reference lives in
*
@param
{
String|Reference
} id The reference to lookup
*
@param
{
Function
} callback
*
@return
{
Reference
}
*/
Reference
.
lookup
=
LookupWrapper
(
Reference
)
;
/**
* Returns true if this reference is not symbolic
*
@return
{
Boolean
}
*/
Reference
.
prototype
.
isConcrete
=
function
(
)
{
return
this
.
type
(
)
==
Reference
.
TYPE
.
OID
;
}
;
/**
* Returns if the ref is pointed at by HEAD
*
@return
{
Boolean
}
*/
Reference
.
prototype
.
isHead
=
function
(
)
{
return
Branch
.
isHead
(
this
)
;
}
;
/**
* Returns true if this reference is symbolic
*
@return
{
Boolean
}
*/
Reference
.
prototype
.
isSymbolic
=
function
(
)
{
return
this
.
type
(
)
==
Reference
.
TYPE
.
SYMBOLIC
;
}
;
/**
* Returns true if this reference is valid
*
@return
{
Boolean
}
*/
Reference
.
prototype
.
isValid
=
function
(
)
{
return
this
.
type
(
)
!=
Reference
.
TYPE
.
INVALID
;
}
;
/**
* Returns the name of the reference.
*
@return
{
String
}
*/
Reference
.
prototype
.
toString
=
function
(
)
{
return
this
.
name
(
)
;
}
;
Back
|
FazBrowse Home
|
New Git URL