Global

Methods

gitBranchIs(branchNameOrTest, optionsopt, nullable, callbackopt, nullable) → {Promise|undefined}

Checks that the current branch of a git repository has a given name.
Parameters:
Name Type Attributes Description
branchNameOrTest string | function Expected name of current branch or a test function to apply to the branch name.
options GitBranchIsOptions <optional>
<nullable>
Options.
callback function <optional>
<nullable>
Callback function called with the return value of branchNameOrTest if it is a function, or the result of identity checking branchNameOrTest to the current branch name.
Source:
Returns:
If callback is not given, a Promise with the return value of branchNameOrTest if it is a function, or the result of identity checking branchNameOrTest to the current branch name.
Type
Promise | undefined

gitBranchIsCmd(argsnon-null, callbackopt, nullable) → {Promise|undefined}

Entry point for this command.
Parameters:
Name Type Attributes Description
args Array.<string> Command-line arguments.
callback function <optional>
<nullable>
Callback for the command result or error. Required if global.Promise is not defined.
Source:
Returns:
If callback is not given and global.Promise is defined, a Promise which will resolve on completion.
Type
Promise | undefined

Type Definitions

CommandResult

Result from command entry points.
Type:
  • Object
Properties:
Name Type Attributes Description
code number <optional>
<nullable>
Exit code for the command.
stdout string <optional>
<nullable>
Content to write to stdout.
stderr string <optional>
<nullable>
Content to write to stderr.
Source:

GitBranchIsOptions

Options for gitBranchIs.
Type:
  • Object
Properties:
Name Type Attributes Description
cwd string <optional>
<nullable>
Current working directory where the branch name is tested.
gitArgs Array <optional>
Extra arguments to pass to git.
gitDir string <optional>
<nullable>
Path to the repository (i.e. --git-dir= option to git).
gitPath string <optional>
Git binary name or path to use (default: 'git').
Source: