Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

don't fail build during plugin application when no .git directory is available #120

@lbergelson

Description

@lbergelson

Currently, if there is no .git directory available it seems like grgit fails during plugin applications.

./gradlew compileJava

...

An exception occurred applying plugin request [id: 'org.ajoberstar.grgit', version: '1.5.1']
> Failed to apply plugin [id 'org.ajoberstar.grgit']
   > One of setGitDir or setWorkTree must be called.

This causes problems for distributing source separately from git. Could this be changed to fail lazily only when commands are invoked rather than when the plugin is applied? That way targets that don't rely on git could still run.

(sorry for the open/close/opening of the issue, I accidentally hit enter and created the issue with a nonsense title, so I closed it until I had time to finish typing it out.)

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