Skip to content

Commit 44f0917

Browse files
committed
fix(cli): When downloading a dataset with no snapshots, checkout draft branch instead of detached commit
1 parent da3a086 commit 44f0917

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cli/src/commands/download.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ export async function downloadAction(
5353
version = options.version
5454
} else if (!options.draft) {
5555
version = await getLatestSnapshotVersion(datasetId)
56+
if (
57+
version.length === 40 /* sha1 */ || version.length === 64 /* sha256 */
58+
) {
59+
// Commit hash -> get the draft instead
60+
version = undefined
61+
}
5662
}
5763

5864
// Clone the repo

0 commit comments

Comments
 (0)