Skip to content

Support Git's safe.bareRepository=explicit config option #4141

Closed

Description

@jason-simmons

Some environments configure GIt with the safe.bareRepository=explicit option in git-config for improved security.

With this setting Flutter's use of pub was failing due to this dependency on a package fetched through Git:
https://github.com/flutter/flutter/blob/master/dev/integration_tests/android_views/pubspec.yaml#L19

The pubspec.yaml specifies a Git URL and commit hash. The .pub-cache was storing this package as a Git bare repository.

With safe.bareRepository=explicit Pub fails to locate the commit hash:

Package not available (Could not find git ref '64d0f6051b9b7b9933d3d16194170a38f544634a'
(fatal: cannot use bare repository '/usr/local/google/home/jsimmons/.pub-cache/git/cache/goldens-9579e0161a174b307c855fff52478bf0dc30bb1a'
(safe.bareRepository is 'explicit'))).

Pub should support Git in this configuration. It may need to pass the --git-dir flag to Git when accessing these repositories in the cache.

Activity

  1. yanok commented on Feb 19, 2024

    @yanok

    Got affected by this today as well.

  2. added
    type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)
    on Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions