How to use git-utils - 5 common examples

To help you get started, we’ve selected a few git-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vzvenyach / scotus-servo / app.js View on Github external
function gitTweet (link, op, fname, callback) {
	var repository = git.open(__dirname)	//Open the repository
	var statusObj = _.pairs(repository.getStatus());	// Get array of [file, status] in the repository.
	tweet(link, fname, repository.getStatus()[fname], op)
	child_process.exec('git add ' + fname, function (err, stdout, stderr) {
		callback()
	})
}
github ijprest / keyboard-layout-editor / tests / screenshot.js View on Github external
image.writeFile(filename, function (err) {
      if (err) {
        return deferred.reject('error saving screenshot: ' + err);
      }
      var status = git.open('.').getStatus(filename.substring(2));
      if(status & 128) {
        return deferred.reject("Warning: new baseline image; add image with:\n\t git add " + filename);
      } else if(status & 256) {
        return deferred.reject("Error: screenshot differs from baseline image; see differences:\n\tgit dt " + filename + "\n     If changes are acceptable:\n\tgit add " + filename);
      }
      return deferred.fulfill();
    });
  });
github cytle / wechat_web_devtools / package.nw / js / 0d657e9d4701812224e40d6b99666d3c.js View on Github external
open(...argus) {
      let _realRepo
      try {
        _realRepo = _realGit.open(...argus)
      } catch (err) {
        _realRepo = null
      }
      if (!_realRepo) {
        return null
      }
      return new Proxy(_realRepo, {
        get(obj, key) {
          const original = obj[key]
          if (typeof original === 'function') {
            return function (...args) {
              let result
              try {
                result = original.apply(obj, args)
              } catch (e) {
                console.log('proxy intercepted an error', e)
github atom / atom / src / git-repository.js View on Github external
constructor(path, options = {}) {
    this.id = nextId++;
    this.emitter = new Emitter();
    this.subscriptions = new CompositeDisposable();
    this.repo = GitUtils.open(path);
    if (this.repo == null) {
      throw new Error(`No Git repository found searching path: ${path}`);
    }

    this.statusRefreshCount = 0;
    this.statuses = {};
    this.upstream = { ahead: 0, behind: 0 };
    for (let submodulePath in this.repo.submodules) {
      const submoduleRepo = this.repo.submodules[submodulePath];
      submoduleRepo.upstream = { ahead: 0, behind: 0 };
    }

    this.project = options.project;
    this.config = options.config;

    if (options.refreshOnWindowFocus || options.refreshOnWindowFocus == null) {
github demian85 / git-watcher / lib / ModuleWatcher.js View on Github external
var ModuleWatcher = function(baseGitRepoPath) {
	events.EventEmitter.call(this);
	var me = this;
	
	me.path = baseGitRepoPath.replace(/[\\\/]$/, '');
	me.repo = require('git-utils').open(me.path);
	me.changeTimer = null;
	me.shouldRefreshIndex = false;
};

git-utils

A package for using Git repositories

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular git-utils functions