FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fetch does not really fetch · Issue #314 · nodegit/nodegit · GitHub

Repository navigation

Fetch does not really fetch #314

Description

As I'm trying to automate some of our git processes, I need to perform 'git fetch' programatically. However the 0.2.3 example does not actually do a fetch..

nodegit.Repository

      // Open the specified directory
        .open(directory).then(function (repo) {
          _repository = repo;
          return nodegit.Remote.load(repo, "origin");
          //return repo.getRemote('origin');

        })
      // Fetch remote
        .then(function (remote) {
          remote.connect(0);
          return remote.download();

          //return remote.fetch(signature);
        })

      // Retrieve all references
        .then(function () {
          return _repository.getReferenceNames(nodegit.Reference.TYPE.ALL);
        })

After this there is a bunch of .then constructions to sort out which branches have been updated, etc... however I notice that nothing is changed/updated after running this fetch sequence. After performing a commandline 'git fetch' things have changed.

I have also tried to npm install the latest checkout from nodegit/master and use the updated example which uses the 'remote shortcut'.

var nodegit = require('../');
var path = require('path');

nodegit.Repository.open(path.resolve(__dirname, '../.git')).then(function(repo) {
  return repo.fetch("origin");
})
.done(function() {
  console.log("It worked!");
});

But also this does not actually do a fetch (as in, no refs or files are updated).

I hope I am missing something, either that or this is a bug.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL