Skip to content

Conversation

@vmaerten
Copy link
Member

Summary

  • Fix "Remote branch HEAD not found" error when cloning remote Taskfiles without explicit ref
  • Fix "is a directory" error when remote Taskfiles include other Taskfiles using directory paths

Problem

Two issues with remote git Taskfiles:

  1. When no ref is specified in the URL, go-getter was passed ref=HEAD which git interprets as a literal branch name, causing clone failures.

  2. When a remote Taskfile includes another using a directory path (e.g., taskfile: ./website), the code tried to read the directory as a file instead of searching for Taskfile.yml inside it.

Solution

  1. Omit the ref parameter entirely when not specified, letting git clone the remote's default branch.

  2. Use fsext.SearchPath to resolve paths, which handles both files and directories transparently.

…xplicit ref

When no ref is specified in a remote Taskfile URL, go-getter was being
passed ref=HEAD which git interprets as a literal branch name, causing
"Remote branch HEAD not found" errors.

Now we omit the ref parameter entirely when not specified, letting git
clone the remote's default branch.
When a remote Taskfile includes another Taskfile using a directory path
(e.g., `taskfile: ./website`), use fsext.SearchPath to properly resolve
it by searching for Taskfile.yml inside the directory.

This also simplifies the logic by delegating all path resolution to
SearchPath, which handles both file and directory paths.
@vmaerten vmaerten changed the title fix(taskfile): omit ref param when cloning remote git repos without e… fix: remote git taskfile cloning and directory includes Dec 23, 2025
@vmaerten vmaerten marked this pull request as ready for review December 23, 2025 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants