@@ -9,7 +9,7 @@ use std::{fs::File, io::Write, path::PathBuf};
9
9
10
10
use git2:: { Oid , Repository } ;
11
11
use serde:: { Deserialize , Serialize } ;
12
- use snafu:: { ensure , OptionExt , ResultExt as _, Snafu } ;
12
+ use snafu:: { OptionExt , ResultExt as _, Snafu } ;
13
13
use tracing_indicatif:: IndicatifLayer ;
14
14
use tracing_subscriber:: { layer:: SubscriberExt as _, util:: SubscriberInitExt as _} ;
15
15
@@ -419,7 +419,7 @@ fn main() -> Result<()> {
419
419
pv,
420
420
upstream,
421
421
base,
422
- mirrored ,
422
+ mirror ,
423
423
} => {
424
424
let ctx = ProductVersionContext {
425
425
pv,
@@ -440,11 +440,9 @@ fn main() -> Result<()> {
440
440
let base_commit = repo:: resolve_and_fetch_commitish ( & product_repo, & base, & upstream) . context ( FetchBaseCommitSnafu ) ?;
441
441
let mut upstream_mirror = None ;
442
442
443
- if mirrored {
443
+ if mirror {
444
444
// 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 } ) ?;
448
446
449
447
let mirror_url = format ! ( "https://github.com/stackabletech/{repo_name}.git" ) ;
450
448
tracing:: info!( mirror_url, "using mirror repository" ) ;
@@ -457,16 +455,18 @@ fn main() -> Result<()> {
457
455
// Push the base commit to the mirror
458
456
tracing:: info!( commit = %base_commit, base = base, url = mirror_url, "pushing commit to mirror" ) ;
459
457
let mut callbacks = git2:: RemoteCallbacks :: new ( ) ;
460
- callbacks. credentials ( |_url , username_from_url, _allowed_types| {
458
+ callbacks. credentials ( |url , username_from_url, _allowed_types| {
461
459
git2:: Cred :: credential_helper (
462
460
& git2:: Config :: open_default ( ) . unwrap ( ) , // Use default git config
463
- _url ,
461
+ url ,
464
462
username_from_url,
465
463
)
466
464
} ) ;
467
465
468
466
// Add progress tracking for push operation
469
467
let ( span_push, mut quant_push) = utils:: setup_progress_tracking ( tracing:: info_span!( "pushing" ) ) ;
468
+ let _ = span_push. enter ( ) ;
469
+
470
470
callbacks. push_transfer_progress ( move |current, total, _| {
471
471
if total > 0 {
472
472
quant_push. update_span_progress (
0 commit comments