Blame.file Async

Blame.file(repo, path, [options]).then(function() {
  // method complete});

Retrieve the blame of a file

Parameters Type  
repo Repository that contains the file
path String to the file to get the blame of
[options] BlameOptions Options for the blame

Blame.initOptions Sync

var result = Blame.initOptions(opts, version);
Parameters Type  
opts BlameOptions The git_blame_options struct to initialize
version Number Version of struct; pass GIT_BLAME_OPTIONS_VERSION
Returns  
Number Zero on success; -1 on failure.

Blame#buffer Async

blame.buffer(buffer, buffer_len).then(function(blame) {
  // Use blame
});
Parameters Type  
buffer String the (possibly) modified contents of the file
buffer_len Number number of valid bytes in the buffer
Returns  
Blame  

Blame#free Sync

blame.free();

Blame#getHunkByIndex Sync

var blameHunk = blame.getHunkByIndex(index);
Parameters Type  
index Number index of the hunk to retrieve
Returns  
BlameHunk the hunk at the given index, or NULL on error

Blame#getHunkByLine Sync

var blameHunk = blame.getHunkByLine(lineno);
Parameters Type  
lineno Number the (1-based) line number to find a hunk for
Returns  
BlameHunk the hunk that contains the given line, or NULL on error

Blame#getHunkCount Sync

var result = blame.getHunkCount();
Returns  
Number  

Blame.FLAG ENUM

Flag Value
Blame.FLAG.NORMAL 0
Blame.FLAG.TRACK_COPIES_SAME_FILE 1
Blame.FLAG.TRACK_COPIES_SAME_COMMIT_MOVES 2
Blame.FLAG.TRACK_COPIES_SAME_COMMIT_COPIES 4
Blame.FLAG.TRACK_COPIES_ANY_COMMIT_COPIES 8
Blame.FLAG.FIRST_PARENT 16