nodegit / nodegit/nodegit

Issue with Repository#fetch/fetchAll fetchOptions

Open
#1,099 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.8k
Forks
704
PR merge metrics
No merged PRs in 30d

Description

I have been trying to fetch the tags of my repo, by setting fetchOptions downloadTags:1. However, it didn't seem to work. Is this method obsolete (see following code for replication)?

let repository = myRepo;
return repository.fetchAll({
    callbacks: {
    certificateCheck: () => {
        return 1;
    },
    credentials: function(url, userName) {
            return git.Cred.userpassPlaintextNew('email', 'access');
    }
    },
    downloadTags: 1
}).then(()=>{ ... });

After a lot of reading, I stumbled upon this way of allowing for tags: git.Remote.setAutotag(repository, remote, 1);. It solved my problem, but I had to look around for a long time.

Am I doing something wrong with my initial code - or is this a bug? If the former, it would be nice to update the docs on this.

I appreciate all your hard work on this project 👍

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Repository#fetch and Repository#fetchAll API documentation and compare the documented fetchOptions behavior with the provided downloadTags: 1 reproduction. Check the git.Remote.setAutotag(repository, remote, 1) usage mentioned in the issue. Done means either documenting the supported tag-fetching approach clearly or identifying the behavior as a bug for follow-up.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, javascript, node.js
Domain
api, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.