Skip to content

git init/commit broken against DO-backed workspace: .git writes vanish, HEAD never appears #133

Description

@DevmanMikey

Summary

Against a Durable Object-backed Workspace (withWorkspace + createGitClient(), @cloudflare/computer@0.2.1, production workerd), the git flow is broken end to end:

  1. ws.git.init({}) resolves successfully but writes nothing — /.git/ never gains HEAD, config, or refs/.
  2. Direct workspace-fs writes under .git/ (mkdir + writeFile of HEAD/config) resolve successfully but vanish: subsequent reads report ENOENT. Non-git paths (including dotfiles elsewhere) persist fine.
  3. ws.git.add() works (index + blobs land, status() reports staged files).
  4. ws.git.commit() then fails with Cannot read properties of null (reading 'startsWith') inside isomorphic-git _commit, which reads <gitdir>/HEAD first thing.

Repro

On a fresh workspace: write a file, status() (throws not-a-repo, as expected), init({}) (resolves), add({paths}) (works), commit({message, author}) → startsWith TypeError. Probing /.git afterwards shows only [index, objects] — no HEAD, ever. Per-board repos (init({dir, defaultBranch})) and symbolic-HEAD-via-updateRef behave identically: silent success, nothing persists.

Impact

Any consumer relying on workspace git (commit/log/history) against DO storage hits this. We worked around it with fs-native snapshotting, but the documented git path (init/add/commit/log) cannot complete a single commit.

Happy to provide a minimal Worker repro or wrangler tail logs on request.

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