Skip to content

Commit 89e5490

Browse files
authored
fix: explicitly specify main branch for hub client in migration utility (#522)
The current hub client does not pass revision into the argument, which causes the moon-landing call to append `create_pr=1` query param to the token API and returns 403 error.
1 parent 9f69239 commit 89e5490

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

data/src/migration_tool/migrate.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@ pub async fn migrate_with_external_runtime(
3333
repo_id: &str,
3434
) -> Result<()> {
3535
let cred_helper = BearerCredentialHelper::new(hub_token.to_owned(), "");
36-
let hub_client =
37-
HubClient::new(hub_endpoint, RepoInfo::try_from(repo_type, repo_id)?, None, "xtool", "", cred_helper)?;
36+
let hub_client = HubClient::new(
37+
hub_endpoint,
38+
RepoInfo::try_from(repo_type, repo_id)?,
39+
Some("main".to_owned()),
40+
"xtool",
41+
"",
42+
cred_helper,
43+
)?;
3844

3945
migrate_files_impl(file_paths, false, hub_client, cas_endpoint, None, false).await?;
4046

0 commit comments

Comments
 (0)