Skip to content

[Bug]: Unclear error when working directory is not a git repository #22

@cschreib

Description

@cschreib

Description

The error message displayed if the working directory is not a git repository is vague and does not point to the root of the problem: Repository is not found or not have change. The error message should say which one it is (no repository, or no change).

Steps to reproduce

  1. Try to scan a repository which has a .dockerignore file excluding .git from the Docker context.
  2. Run codefox scan in Docker, mounting the repository to analyze as a bind mount.

Expected behavior

A clear error message explaining that the directory is not a git repository (.git not found).

Actual behavior

Repository is not found or not have change

Environment

  • OS: Ubuntu 22.04
  • Python version: 3.11
  • CodeFox version: 0.4.6
  • Provider: N/A
  • Model: N/A

Config (optional)

Not relevant.

Additional context

I want to run CodeFox in a Docker container for security. Our repo uses .dockerignore to reduce the Docker context size when building our product, and .git is excluded since unnecessary. Sadly this conflicts with CodeFox, which needs .git. It was not easy for me to understand why it was not working, and clearer error messages would have helped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions