Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

🐛 Fixed not ignoring nested git repositories #105

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

segiddins
Copy link

For example, suppose you have a repo, Rainforest,
whose .gitignore is simply *.
Inside Rainforest is another git repo, Repo.
If you open Repo as your project directory,
it will now be auto-completed, as the root
is no longer considered ignored.

Fixes a situation described in #87.

@winstliu
Copy link
Contributor

It looks like you broke a spec with this change - could you please fix it and add a spec that tests this change? Thanks.

@segiddins
Copy link
Author

I don't really understand what the spec I broke is testing. I'd be happy to add a new spec for this change, but I've really only poked around and am not too familiar with how to test this change.

@segiddins
Copy link
Author

I'd appreciate some help in understanding what the failing test is actually trying to test so I can fix it and get this PR merged.

@lee-dohm
Copy link
Contributor

lee-dohm commented Jun 3, 2015

Test code:

    describe "when core.excludeVcsIgnoredPaths is set to true", ->
      beforeEach ->
        atom.config.set("core.excludeVcsIgnoredPaths", true)

      describe "when the .gitignore matches parts of the path to the root folder", ->
        beforeEach ->
          ignoreFile = path.join(projectPath, '.gitignore')
          fs.writeFileSync(ignoreFile, path.basename(projectPath))

        it "only applies the .gitignore patterns to relative paths within the root folder", ->
          dispatchCommand('toggle-file-finder')
          projectView.setMaxItems(Infinity)

          waitForPathsToDisplay(projectView)

          runs ->
            expect(projectView.list.find("li:contains(file.txt)")).toExist()

What this is doing is:

  1. When the "Exclude VCS Ignored Paths" setting is true
  2. And some part of the project path itself is in the .gitignore file (ex: your project is at /home/username/project/foo and project is in the .gitignore file)
  3. The files inside your project (that aren't in a /home/username/project/foo/**/project/ directory) still show up

@segiddins
Copy link
Author

This is now passing!

@segiddins
Copy link
Author

(See also atom/git-utils#45)

@segiddins
Copy link
Author

What can I do to help get this 🚢?

@kevinsawicki
Copy link
Contributor

What can I do to help get this 🚢?

Adding an additional spec that tests what this fixes would help to get this shipped.

@segiddins
Copy link
Author

I just tried to come up with a spec for this, but I'm struggling, sorry.

For example, suppose you have a repo, `Rainforest`,
whose .gitignore is simply `*`.
Inside Rainforest is another git repo, `Repo`.
If you open `Repo` as your project directory,
it will now be auto-completed, as the root
is no longer considered ignored.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants