@@ -389,28 +389,26 @@ async def send(self) -> CommitResult:
389389 "Code-Storage-Agent" : get_user_agent (),
390390 }
391391
392- async with (
393- httpx .AsyncClient () as client ,
394- client .stream (
392+ async with httpx .AsyncClient () as client :
393+ async with client .stream (
395394 "POST" ,
396395 self .url ,
397396 headers = headers ,
398397 content = self ._build_request_body (metadata ),
399398 timeout = 180.0 ,
400- ) as response ,
401- ):
402- if not response .is_success :
403- error_info = await _parse_commit_error (response , "createCommit" )
404- raise RefUpdateError (
405- error_info ["message" ],
406- status = error_info ["status" ],
407- reason = error_info ["status" ],
408- ref_update = error_info .get ("ref_update" ),
409- )
410-
411- result_data = await response .aread ()
412- result = json .loads (result_data )
413- return _build_commit_result (result )
399+ ) as response :
400+ if not response .is_success :
401+ error_info = await _parse_commit_error (response , "createCommit" )
402+ raise RefUpdateError (
403+ error_info ["message" ],
404+ status = error_info ["status" ],
405+ reason = error_info ["status" ],
406+ ref_update = error_info .get ("ref_update" ),
407+ )
408+
409+ result_data = await response .aread ()
410+ result = json .loads (result_data )
411+ return _build_commit_result (result )
414412
415413 def _build_metadata (self ) -> Dict [str , Any ]:
416414 """Build metadata payload for commit."""
@@ -491,28 +489,26 @@ async def request_stream() -> AsyncIterator[bytes]:
491489
492490 url = f"{ base_url .rstrip ('/' )} /api/v{ api_version } /repos/diff-commit"
493491
494- async with (
495- httpx .AsyncClient () as client ,
496- client .stream (
492+ async with httpx .AsyncClient () as client :
493+ async with client .stream (
497494 "POST" ,
498495 url ,
499496 headers = headers ,
500497 content = request_stream (),
501498 timeout = 180.0 ,
502- ) as response ,
503- ):
504- if not response .is_success :
505- error_info = await _parse_commit_error (response , "createCommitFromDiff" )
506- raise RefUpdateError (
507- error_info ["message" ],
508- status = error_info ["status" ],
509- reason = error_info ["status" ],
510- ref_update = error_info .get ("ref_update" ),
511- )
499+ ) as response :
500+ if not response .is_success :
501+ error_info = await _parse_commit_error (response , "createCommitFromDiff" )
502+ raise RefUpdateError (
503+ error_info ["message" ],
504+ status = error_info ["status" ],
505+ reason = error_info ["status" ],
506+ ref_update = error_info .get ("ref_update" ),
507+ )
512508
513- result_data = await response .aread ()
514- result = json .loads (result_data )
515- return _build_commit_result (result )
509+ result_data = await response .aread ()
510+ result = json .loads (result_data )
511+ return _build_commit_result (result )
516512
517513
518514def resolve_commit_ttl_seconds (options : Optional [CreateCommitOptions ]) -> int :
0 commit comments