Skip to content

clone() hides checkout failures #19

Closed

Description

@dnnsjsk

Pitmaster::clone() catches every Throwable from the final checkout and returns the repository as if the clone succeeded (

pitmaster/src/Pitmaster.php

Lines 468 to 478 in 5beb97d

try {
if ($headId !== null) {
if (str_starts_with($headRef, 'refs/heads/')) {
$repo->checkout(substr($headRef, 11));
} else {
$repo->checkout($headId->hex);
}
}
} catch (\Throwable) {
// Clone succeeded but checkout failed; repo is still valid
}
). A checkout failure (missing objects after a partial transfer, a path that cannot be written, a hook error) leaves an empty or partial working tree with no error reported to the caller.

Expected

Let the exception propagate (or wrap it), so callers can tell a complete clone from one whose checkout failed. git reports "warning: Clone succeeded, but checkout failed" and exits non-zero.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions