Class: Clone

Clone(path, repo)

The Clone class to clone and manage the Git repository

Constructor

new Clone(path, repo)

Constructs a Clone object.
WARNING: Not to be instantiated directly, see init
Parameters:
Name Type Description
path string Path to the repository location on drive
repo Git.Clone A Git.Clone instance
Source:

Methods

(async, static) init(url, optionsopt) → {Promise.<Clone>}

Initialize and return an instance of the Clone class.
Parameters:
Name Type Attributes Description
url string A valid URL to a Git repository.
options CloneOptions <optional>
cloning options
Source:
Returns:
A promise to a Clone instance.
Type
Promise.<Clone>

(async) foreachCommit(commits, action, catcher) → {Array.<(T|S)>}

Maps an action function to all the commits provided. If the action function throws an error, applies the catcher funtion to that commit. Then returns the results in the order given.
Parameters:
Name Type Description
commits Array.<Commit> The list of Commit.
action commitActionFunction.<T> The function to apply to each commit
catcher commitCatcherFunction.<S> The function to catch errors if the action function throws.
Source:
Returns:
- The results
Type
Array.<(T|S)>

(async) headCommitHistory() → {Promise.<Array.<Commit>>}

Gets the commit history from the HEAD commit
Source:
Returns:
The commit history. See Commit.
Type
Promise.<Array.<Commit>>

(async) staticAnalysis(optionsopt) → {Object.<string, ExtensionSummary>}

Performs static analysis of code on disk and returns a report of the results.
Parameters:
Name Type Attributes Description
options Object <optional>
The options
Properties
Name Type Attributes Default Description
excludedDirs Array.<string> <optional>
['.git'] A list of directories to be excluded. Only '.git' by default.
excludedExts Array.<string> <optional>
[] A list of extensions to be excluded.
Source:
Returns:
An object with file extensions as keys and an object with all static analyses results as the value.
Type
Object.<string, ExtensionSummary>