Skip to content

Tasks with copier update fail if they need a Git repo #2478

@jashan-lco

Description

@jashan-lco

Describe the problem

I have a task that relies on the project tree being a Git repository. i.e. I'm using gh (Github CLI) to perform some automation after a template has been rendered.

Everything works fine when using copier copy, but when doing a copier update things fail. Doing a cursory check it looks like copier does not create a Git repo under /tmp/copier._main.old_copy.0si_f3td, which causes tools that expect the source tree to be such to fail.

Template

copier.yaml:

_tasks:
  - |-
        gh api --method PATCH repos/{owner}/{repo}/properties/values -f 'properties[][property_name]=something' -f 'properties[][value]=true'

To Reproduce

  1. Run copier copy
  2. Then run copier update

Logs

Expected behavior

Tasks should run the same, whether for copy or update

Screenshots/screencasts/logs

No response

Operating system

Linux

Operating system distribution and version

Archlinux

Copier version

9.11.0

Python version

CPython 3.13

Installation method

distro package

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtriageTrying to make sure if this is valid or not

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions