Reference.create AsyncExperimental
Reference.create(repo, name, id, force, log_message).then(function(reference) {
// Use reference
});
| Parameters |
Type |
|
| repo |
Repository |
Repository where that reference will live |
| name |
String |
The name of the reference |
| id |
Oid |
The object id pointed to by the reference. |
| force |
Number |
Overwrite existing references |
| log_message |
String |
The one line long message to be appended to the reflog |
Reference.createMatching AsyncExperimental
Reference.createMatching(repo, name, id, force, current_id, log_message).then(function(reference) {
// Use reference
});
| Parameters |
Type |
|
| repo |
Repository |
Repository where that reference will live |
| name |
String |
The name of the reference |
| id |
Oid |
The object id pointed to by the reference. |
| force |
Number |
Overwrite existing references |
| current_id |
Oid |
The expected value of the reference at the time of update |
| log_message |
String |
The one line long message to be appended to the reflog |
Reference.dwim Async
Reference.dwim(repo, id, callback).then(function(reference) {
// Use reference
});
Retrieves the reference by it’s short name
| Parameters |
Type |
|
| repo |
Repository |
The repo that the reference lives in |
| id |
String, Reference |
The reference to lookup |
| callback |
Function |
|
Reference.ensureLog SyncExperimental
var result = Reference.ensureLog(repo, refname);
| Parameters |
Type |
|
| repo |
Repository |
the repository |
| refname |
String |
the reference’s name |
| Returns |
|
| Number |
0 or an error code. |
Reference.hasLog SyncExperimental
var result = Reference.hasLog(repo, refname);
| Parameters |
Type |
|
| repo |
Repository |
the repository |
| refname |
String |
the reference’s name |
| Returns |
|
| Number |
0 when no reflog can be found, 1 when it exists; |
| otherwise an error code. |
|
Reference.isValidName SyncExperimental
var result = Reference.isValidName(refname);
| Parameters |
Type |
|
| refname |
String |
name to be checked. |
| Returns |
|
| Number |
1 if the reference name is acceptable; 0 if it isn’t |
Reference.list AsyncExperimental
Reference.list(repo).then(function(array) {
// Use array
});
| Parameters |
Type |
|
| repo |
Repository |
Repository where to find the refs |
Reference.lookup Async
Reference.lookup(repo, id, callback).then(function(reference) {
// Use reference
});
Retrieves the reference pointed to by the oid
| Parameters |
Type |
|
| repo |
Repository |
The repo that the reference lives in |
| id |
String, Reference |
The reference to lookup |
| callback |
Function |
|
Reference.nameToId AsyncExperimental
Reference.nameToId(repo, name).then(function(oid) {
// Use oid
});
| Parameters |
Type |
|
| repo |
Repository |
The repository in which to look up the reference |
| name |
String |
The long name for the reference (e.g. HEAD, refs/heads/master, refs/tags/v0.1.0, …) |
Reference.normalizeName SyncExperimental
var result = Reference.normalizeName(buffer_out, buffer_size, name, flags);