Skip to content

vcsh clone fails to clone from a shallow repository #345

Open
@yacoob

Description

@yacoob

Steps to reproduce:

git clone --depth=1 https://github.com/yacoob/dotfiles /tmp/bootstrap
vcsh clone -b main file:///tmp/bootstrap

Normal git doesn't have a problem cloning from a shallow repository. vcsh fails to do so:

Initialized empty Git repository in /root/.config/vcsh/repo.d/bootstrap.git/
Switched to a new branch 'main'
remote: Enumerating objects: 63, done.
remote: Counting objects: 100% (63/63), done.
remote: Compressing objects: 100% (50/50), done.
remote: Total 63 (delta 0), reused 63 (delta 0), pack-reused 0
Unpacking objects: 100% (63/63), 20.02 KiB | 539.00 KiB/s, done.
error: Could not read ab41f5b88f9c170d167c1a44fa93159b9fa13ed1
fatal: Failed to traverse parents of commit 37cd7c6d313013a4e535a57a92a273a745224eee
error: file:///tmp/bootstrap did not send all necessary objects

fatal: Not a valid object name origin/main
merge: origin/main - not something we can merge

A shallow repository is often used in CI environments; my use case is running vcsh clone against a single-commit checkout inside a Github Action. My current workaround is to fetch the entire repository (fetch-depth: 0 in actions/checkout). This workaround is not feasible for a larger repository.

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