From 44f0917993f0beffc1c0e9656cc74bd984013fe5 Mon Sep 17 00:00:00 2001 From: Nell Hardcastle Date: Mon, 10 Nov 2025 13:53:33 -0800 Subject: [PATCH] fix(cli): When downloading a dataset with no snapshots, checkout draft branch instead of detached commit --- cli/src/commands/download.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli/src/commands/download.ts b/cli/src/commands/download.ts index a1d4e5a53..efa41110e 100644 --- a/cli/src/commands/download.ts +++ b/cli/src/commands/download.ts @@ -53,6 +53,12 @@ export async function downloadAction( version = options.version } else if (!options.draft) { version = await getLatestSnapshotVersion(datasetId) + if ( + version.length === 40 /* sha1 */ || version.length === 64 /* sha256 */ + ) { + // Commit hash -> get the draft instead + version = undefined + } } // Clone the repo