Skip to content

Files are not excluded as expected #4902

@williamdes

Description

@williamdes

Reproduction steps

Node git

  • Unzip testbench.zip
  • npm install
  • node status.js
  • Files are marked as new
  • cd test-repo/
  • git status
  • No new files

Manual

  • git clone https://github.com/phpmyadmin/phpmyadmin
  • cd phpmyadmin
  • git reset --hard 61b98cf9cc821f9a500a4fe374da92a59b965092
  • npm run css-compile
  • You can see using GitKraken (they use libgit2) that the files are marked as new
  • Same using the following code
var nodegit = require("nodegit"), path = require("path");
nodegit.Repository.open(path.resolve(__dirname, "test-repo/.git"))
  .then(function(repo) {
    repo.getStatus().then(function(statuses) {
      function statusToText(status) {
        var words = [];
        if (status.isNew()) { words.push("NEW"); }
        if (status.isModified()) { words.push("MODIFIED"); }
        if (status.isTypechange()) { words.push("TYPECHANGE"); }
        if (status.isRenamed()) { words.push("RENAMED"); }
        if (status.isIgnored()) { words.push("IGNORED"); }

        return words.join(" ");
      }

      statuses.forEach(function(file) {
        console.log(file.path() + " " + statusToText(file));
      });
    });
});

Expected behavior

Like when using git, files are ignored

Actual behavior

Files as flagged as new and not ignored

Version of libgit2 (release number or SHA1)

Using https://github.com/nodegit/nodegit (0.23.0)
[email protected]

Operating system(s) tested

Linux (Ubuntu 18.04)

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