@@ -9,7 +9,7 @@ use std::{fs::File, io::Write, path::PathBuf};
99
1010use git2:: { Oid , Repository } ;
1111use serde:: { Deserialize , Serialize } ;
12- use snafu:: { ensure , OptionExt , ResultExt as _, Snafu } ;
12+ use snafu:: { OptionExt , ResultExt as _, Snafu } ;
1313use tracing_indicatif:: IndicatifLayer ;
1414use tracing_subscriber:: { layer:: SubscriberExt as _, util:: SubscriberInitExt as _} ;
1515
@@ -419,7 +419,7 @@ fn main() -> Result<()> {
419419 pv,
420420 upstream,
421421 base,
422- mirrored ,
422+ mirror ,
423423 } => {
424424 let ctx = ProductVersionContext {
425425 pv,
@@ -440,11 +440,9 @@ fn main() -> Result<()> {
440440 let base_commit = repo:: resolve_and_fetch_commitish ( & product_repo, & base, & upstream) . context ( FetchBaseCommitSnafu ) ?;
441441 let mut upstream_mirror = None ;
442442
443- if mirrored {
443+ if mirror {
444444 // Parse e.g. "https://github.com/apache/druid.git" into "druid"
445- let repo_name = upstream. split ( '/' ) . last ( ) . map ( |repo| repo. trim_end_matches ( ".git" ) ) . context ( ParseUpstreamUrlSnafu { url : & upstream } ) ?;
446-
447- ensure ! ( !repo_name. is_empty( ) , ParseUpstreamUrlSnafu { url: & upstream } ) ;
445+ let repo_name = upstream. split ( '/' ) . last ( ) . map ( |repo| repo. trim_end_matches ( ".git" ) ) . filter ( |name| !name. is_empty ( ) ) . context ( ParseUpstreamUrlSnafu { url : & upstream } ) ?;
448446
449447 let mirror_url = format ! ( "https://github.com/stackabletech/{repo_name}.git" ) ;
450448 tracing:: info!( mirror_url, "using mirror repository" ) ;
@@ -457,16 +455,18 @@ fn main() -> Result<()> {
457455 // Push the base commit to the mirror
458456 tracing:: info!( commit = %base_commit, base = base, url = mirror_url, "pushing commit to mirror" ) ;
459457 let mut callbacks = git2:: RemoteCallbacks :: new ( ) ;
460- callbacks. credentials ( |_url , username_from_url, _allowed_types| {
458+ callbacks. credentials ( |url , username_from_url, _allowed_types| {
461459 git2:: Cred :: credential_helper (
462460 & git2:: Config :: open_default ( ) . unwrap ( ) , // Use default git config
463- _url ,
461+ url ,
464462 username_from_url,
465463 )
466464 } ) ;
467465
468466 // Add progress tracking for push operation
469467 let ( span_push, mut quant_push) = utils:: setup_progress_tracking ( tracing:: info_span!( "pushing" ) ) ;
468+ let _ = span_push. enter ( ) ;
469+
470470 callbacks. push_transfer_progress ( move |current, total, _| {
471471 if total > 0 {
472472 quant_push. update_span_progress (
0 commit comments