Skip to content

Invalid ancestor .git marker prevents adding a plain folder #4806

Closed

Description

@faga295

What happened

A plain folder nested below an incomplete .git directory is treated as if it were inside a Git repository. Adding the folder through Project Catalog then invokes Git; git rev-parse fails and the mutation surfaces as project.catalog.mutate → commit_outcome_unknown.

Expected: if the selected folder has no .git entry and an ancestor's .git metadata is structurally invalid, Maka should handle the selection like an ordinary non-Git folder. A malformed .git entry in the selected folder itself should continue to fail closed.

How to reproduce

  1. Create an incomplete ancestor Git marker and a nested plain folder:
    mkdir -p /tmp/maka-invalid-git/.git/gk /tmp/maka-invalid-git/project
  2. Open Maka Desktop.
  3. Add /tmp/maka-invalid-git/project as a project.
  4. Observe that registration fails with project.catalog.mutate → commit_outcome_unknown.

git -C /tmp/maka-invalid-git/project rev-parse --show-toplevel also exits 128 because Git discovers the malformed ancestor marker.

Environment

  • Maka version or commit: fde5fb0
  • OS and version: macOS 14.7.8
  • Surface: Desktop / Runtime Host Project Catalog
  • Node.js version, if running from source: v25.9.0

Logs, screenshots, or additional context

The ancestor .git contains only .git/gk/; it has no HEAD. hasEnclosingGitEntry currently treats any lstat-able .git entry as a repository marker, so the downstream Git probe receives corrupted ancestor state.

Activity

  1. added
    bug
    on Sep 4, 2026
  2. faga295 commented on Sep 4, 2026

    @faga295
    ContributorAuthor

    take

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

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions