forked from nodegit/nodegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreference.js
More file actions
46 lines (39 loc) · 919 Bytes
/
Copy pathreference.js
File metadata and controls
46 lines (39 loc) · 919 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
37
38
39
40
41
42
43
44
45
46
var NodeGit = require("../");
var Reference = NodeGit.Reference;
var Branch = NodeGit.Branch;
/**
* Returns true if this reference is valid
* @return {Boolean}
*/
Reference.prototype.isValid = function() {
return this.type() != Reference.TYPE.INVALID;
};
/**
* Returns true if this reference is not symbolic
* @return {Boolean}
*/
Reference.prototype.isConcrete = function() {
return this.type() == Reference.TYPE.OID;
};
/**
* Returns true if this reference is symbolic
* @return {Boolean}
*/
Reference.prototype.isSymbolic = function() {
return this.type() == Reference.TYPE.SYMBOLIC;
};
/**
* Returns the name of the reference.
* @return {String}
*/
Reference.prototype.toString = function() {
return this.name();
};
/**
* Returns if the ref is pointed at by HEAD
* @return {bool}
*/
Reference.prototype.isHead = function() {
return Branch.isHead(this);
};
module.exports = Reference;