Documentation generator: JsDoc Toolkit 2.4.0
Template: Codeview 1.2
Generated on: 2011-3-3 14:20

Class Reference

Class Summary
Constructor Attributes Constructor Name and Description
 
A reference serves as a pointer of sorts to a specific Commit.
Field Summary
Field Attributes Field Name and Description
 
The name of the reference - e.g refs/heads/master
 
Either the SHA1 hash of the Commit being pointed to by this Reference, if it's type is "oid".
 
The type of reference this is.

Method Summary

Method Attributes Method Name and Description
 
delete(callback)
Deletes the Reference permanently.
 
rename(newName, callback)
Renames this Reference.
 
resolve(callback)
Resolves this Reference to a direct oid Reference.
 
setTarget(newTarget, callback)
Sets the target of this Reference.

Class Detail

Reference()
A reference serves as a pointer of sorts to a specific Commit. References can either be direct or symbolic. Direct references point to a commit OID, symbolic references point to other references (which may also be symbolic).
See:
Repository#getReference
Repository#createOidReference
Repository#createSymbolicReference

Field Detail

{String} name
The name of the reference - e.g refs/heads/master
{String} target
Either the SHA1 hash of the Commit being pointed to by this Reference, if it's type is "oid". If it's a symbolic Reference, this will point to another reference name.
{String} type
The type of reference this is. Can be either "oid" or "symbolic". CANNOT be changed.

Method Detail

  • {Boolean} delete(callback)
    Deletes the Reference permanently. Once deleted, the Reference will no longer be accessible from the Repository. It will be deleted from the filesystem also. If this Reference is involved in any symbolic link chains, they will become invalid. After calling this, any further calls on the Reference will throw an Error.
    Parameters:
    {Function} callback Optional
    If provided, the deletion will occur asynchronously and return the status of the delete to the callback.
    Throws:
    If an error occurred while deleting the Reference.
    Returns:
    {Boolean} true if successful
  • {Boolean} rename(newName, callback)
    Renames this Reference. Name of the new Reference must not already exist in the Repository.
    Parameters:
    {String} newName
    The new name.
    {Function} callback Optional
    If provided, the rename will occur asynchronously, and the callback will be fired when rename has completed.
    Throws:
    If an error occurred during renaming process.
    Returns:
    {Boolean} true if successful.
  • {Reference} resolve(callback)
    Resolves this Reference to a direct oid Reference. This means it will follow symbolic links until it arrives at the direct link pointing to a {@ link Commit}. Note that if you call this on a Reference that is already pointing to a Commit, it will just return the Reference.
    Parameters:
    {Function} callback Optional
    When given, the resolution will be done asynchronously and the resulting Reference passed to the callback.
    Throws:
    If an error occurred while resolving the Reference.
    Returns:
    {Reference} The result of the resolution.
  • {Boolean} setTarget(newTarget, callback)
    Sets the target of this Reference. This change is immediate. Note: You can't change the type of a Reference. For example, if this Reference is an OID reference, you can't set the target to another Reference. If you need to do this, delete the original ref, and recreate it as the other type.
    Parameters:
    {String} newTarget
    either the oid, or name of another Reference.
    {Function} callback Optional
    If provided, the Reference will be re-targeted asynchronously. The callback will be notified when this occurs.
    Throws:
    If an error occurred while setting target.
    Returns:
    {Boolean} true if successful.