src/commands.js
function add(options) {
    assert.ok(options.files, 'files is mandatory');

    return options.files
        .filter(function(file) {
          //Git exits OK with empty filenames.
          //Avoid an unnecessary call to git in these cases by removing the filename
          return !!file;
        })
        .reduce(function(soFar, file) {
          var args = ['add', file];
          return soFar
              .then(gitFn(args))
              .then(silent);
        }, Promise.resolve());
  }
function add(options) {
    assert.ok(options.files, 'files is mandatory');

    return options.files
        .filter(function(file) {
          //Git exits OK with empty filenames.
          //Avoid an unnecessary call to git in these cases by removing the filename
          return !!file;
        })
        .reduce(function(soFar, file) {
          var args = ['add', file];
          return soFar
              .then(gitFn(args))
              .then(silent);
        }, Promise.resolve());
  }
function add ( options ) { assert . ok ( options . files , 'files is mandatory' ) ; return options . files . filter ( function ( file ) { //Git exits OK with empty filenames. //Avoid an unnecessary call to git in these cases by removing the filename return ! ! file ; } ) . reduce ( function ( soFar , file ) { var args = [ 'add' , file ] ; return soFar . then ( gitFn ( args ) ) . then ( silent ) ; } , Promise . resolve ( ) ) ; }
Adds filenames to the stashing area
Issues `git add README.md`

@example
var git = require('gitftw');

git.add({
files: ['README.md', 'index.js']
});

@memberof git
@type {command}

@param {Object} options The options object. All its properties are {@link Resolvable}
@param {Resolvable|Array<String>} options.files The files to be added, relative to the cwd
@param {callback} [cb] The execution callback result
@returns {Promise} Promise Resolves with undefined
Adds filenames to the stashing area Issues git add README . md