Skip to content

set-safe-directory: true is not sufficient for submodules #915

@sdroege

Description

@sdroege

See gtk-rs/gtk-rs-core#760 for an example where this fails.

In this repository there are some submodules that are configured with update = none, i.e. git submodule update --init --recursive is not going to fetch them. For some CI tasks we still want to have them though, so it is necessary to run git submodule update --checkout.

This does not work and fails as follows:

Run actions/checkout@v3
[...]
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /__w/gtk-rs-core/gtk-rs-core
[...]
Run git submodule update --checkout
fatal: unsafe repository ('/__w/gtk-rs-core/gtk-rs-core' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /__w/gtk-rs-core/gtk-rs-core
Error: Process completed with exit code 128.

It's unclear how to work around this as the suggested solution from the error message is clearly already done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions