Skip to content

Commit

Permalink
More documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam committed Apr 3, 2011
1 parent 5f6d532 commit 6bc0679
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions lib/bindings/bindings.js
Expand Up @@ -355,6 +355,77 @@ var Blob = function() {};
*/
Blob.prototype.save = function(callback) {};

/**
* The Index represents the cache Git stores for your working directory. When
* you "stage" a file in Git, this is basically just a command that will add
* or update your file in the Git index. Running a Commit in Git is essentially
* just writing a Commit with a Tree that matches an Index. <b>Note:</b> There
* will be a method soon to create a Tree from an opened Index, this feature has
* not yet been implemented by libgit2, as soon as it is it will be in Gitteh.
* @class
* @property {Integer} entryCount <i>Read-only</i> How many entries are contained in the Index.
*/
var Index = function() {};

/**
* Retrieves an {@link IndexEntry} from the Index.
* @param {Integer} index The index to retrieve.
* @param {Function} [callback] When provided, IndexEntry will be retrieved asynchronously and provided back to the callback.
* @return {IndexEntry}
* @throws If index is out of bounds, or some other error occurs.
*/
Index.prototype.getEntry = function(index, callback) {};

/**
* Searches the Index for an entry that matches the given filename.
* @param {String} [fileName] The filename of entry to search for.
* @param {Function} [callback] If provided, entry will be searched for in a non-blocking manner, and results returned to the callback.
* @return {IndexEntry}
* @throws If entry could not be found, or some other error occurs.
*/
Index.prototype.findEntry = function(fileName, callback) {};

/**
* Adds an entry to the Index for the given fileName. This file should already
* exist in the working directory of the Repository. <b>Note:</b> this function
* will fail if called on a Index for a bare repository, as it has no working
* directory.
* @param {String} fileName Name of the file to update index entry for.
* @param {Function} [callback] When provided, the callback will be notified when the entry has been added asynchronously.
* @returns {Boolean} true if successful
* @throws If there was an error adding the entry.
*/
Index.prototype.addEntry = function(fileName, callback) {};

/**
* Changes to an Index will not be updated on the actual index file until this
* method is called.
* @param {Function} [callback] When provided, the writeback will be performed in an asynchronous fashion, and the result will be passed back to the callback.
* @returns {Boolean} true if successful.
* @throws If there was an error writing the Index.
*/
Index.prototype.write = function(callback) {};

/**
* Represents a single entry in the Git {@link Index}. <b>Note:</b> While the
* constructor for this class <i>is</i> being exposed, it is not recommended to
* extend its functionality, as it may be removed altogether in a future release.
* @class
* @property {Date} ctime
* @property {Date} mtime
* @property {Integer} dev
* @property {Integer} ino
* @property {Integer} mode
* @property {Integer} uid
* @property {Integer} gid
* @property {Integer} file_size
* @property {String} oid
* @property {Integer} flags
* @property {Integer} flags_extended
* @property {String} path
*/
var IndexEntry = function() {};

/**
* A RevisionWalker provides a clean interface to walk the commit history of a
* {@link Repository}. A RevisionWalker may be obtained via {@link Repository#createWalker}
Expand Down

0 comments on commit 6bc0679

Please sign in to comment.