Transaction.create
Transaction.create(repo).then(function(transaction) {
// Use transaction
});
| Parameters | Type | |
|---|---|---|
| repo | Repository | the repository in which to lock |
| Returns | |
|---|---|
| Transaction | the resulting transaction |
Transaction#commit
var result = transaction.commit();
| Returns | |
|---|---|
| Number | 0 or an error code |
Transaction#lockRef
var result = transaction.lockRef(refname);
| Parameters | Type | |
|---|---|---|
| refname | String | the reference to lock |
| Returns | |
|---|---|
| Number | 0 or an error message |
Transaction#remove
var result = transaction.remove(refname);
| Parameters | Type | |
|---|---|---|
| refname | String | the reference to remove |
| Returns | |
|---|---|
| Number | 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code |
Transaction#setReflog
var result = transaction.setReflog(refname, reflog);
| Parameters | Type | |
|---|---|---|
| refname | String | the reference whose reflog to set |
| reflog | Reflog | the reflog as it should be written out |
| Returns | |
|---|---|
| Number | 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code |
Transaction#setSymbolicTarget
var result = transaction.setSymbolicTarget(refname, target, sig, msg);
| Parameters | Type | |
|---|---|---|
| refname | String | reference to update |
| target | String | target to set the reference to |
| sig | Signature | signature to use in the reflog; pass NULL to read the identity from the config |
| msg | String | message to use in the reflog |
| Returns | |
|---|---|
| Number | 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code |
Transaction#setTarget
var result = transaction.setTarget(refname, target, sig, msg);
| Parameters | Type | |
|---|---|---|
| refname | String | reference to update |
| target | Oid | target to set the reference to |
| sig | Signature | signature to use in the reflog; pass NULL to read the identity from the config |
| msg | String | message to use in the reflog |
| Returns | |
|---|---|
| Number | 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code |