Skip to content

config value 'safe.directory' was not found #16

@ernstki

Description

@ernstki

Probably everybody else has already dealt with this, but I work in an environment which lags behind the latest releases of things like Git by quite a ways.

Building git-hist 1.0.5 with cargo and Rust 1.71 is successful, but I receive this error message upon actually running git hist FILENAME:

$ git-hist FILENAME
Error: Faild to open a git repository for the current directory

Caused by:
    config value 'safe.directory' was not found; class=Config (7); code=NotFound (-3)

I believe this relates to a recently-discovered security vulnerability in Git, and a resulting workaround in git2-rs. I'll update the issue description with references as I do more research.

As a temporary workaround, you can define GIT_CEILING_DIRECTORIES as described here. Edit: git2-rs really wants what it says it wants, which is to see safe.directory for the current directory in ~/.gitconfig. Here's how to add that:

$ git config --add --global safe.directory $PWD

Possibly related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions