Skip to content

projectile-mode doesn't recognize subproject when .projectile file exist in parent project #1730

@dadinn

Description

@dadinn

Expected behavior

I have a parent git project called .emacs.d which has the following directory structure

.emacs.d
  |- .projectile
  |- init.el
  |- straight
     |- repos
        |- projectile
           |- projectile.el
           |- README.md

The .projectile file can be empty.
The straight/repos/projectile directory is another git repo (this one actually), cloned by straight.el.
Let's suppose that I have opened ./straight/projectile/projectile.el file, and then I try to use projectile-find-file command to find any other file in the projectile repo.
I should be able to do this and see files listed from the projectile git repository (e.g. README.md), and not other files from the parent .emacs.d repo (e.g. init.el).

Actual behavior

projectile-find-file shows the files from the .emacs.d repo, and not from the projectile repo instead.
Once I remove the offending .projectile file from the parent .emacs.d folder, I am able to list only the files inside the projectile repository instead.

Steps to reproduce the problem

  • Configure straight.el and install projectile repo.
  • Create a .projectile file in the .emacs.d directory,
  • open ./straight/repos/projectile/projectile.el file.
  • press C-c p f to call projectile-find-file

Environment & Version information

Projectile version information

2.5.0

Emacs version

27.1

Operating system

Debian 11

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions