From 0c5617bf8d88a0f5edaedaf7d47ddd0780aefe33 Mon Sep 17 00:00:00 2001 From: Alexander Regueiro Date: Wed, 29 Jan 2020 03:38:04 +0000 Subject: [PATCH] Handle `--force` option correctly in any position --- hg-fast-export.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/hg-fast-export.sh b/hg-fast-export.sh index e1f2f50..7090793 100755 --- a/hg-fast-export.sh +++ b/hg-fast-export.sh @@ -110,7 +110,7 @@ if [ "true" = "$IGNORECASE" ]; then IGNORECASEWARN="true" fi; - +HG2GIT_ARGS=() while case "$#" in 0) break ;; esac do case "$1" in @@ -125,14 +125,10 @@ do # pass --force to git-fast-import and hg-fast-export.py GFI_OPTS="$GFI_OPTS --force" IGNORECASEWARN=""; - break ;; - -*) - # pass any other options down to hg2git.py - break - ;; - *) - break + # pass all other args down to hg2git.py + *) + HG2GIT_ARGS+=("$1") ;; esac shift @@ -187,7 +183,7 @@ $( --mapping "$GIT_DIR/$PFX-$SFX_MAPPING" \ --heads "$GIT_DIR/$PFX-$SFX_HEADS" \ --status "$GIT_DIR/$PFX-$SFX_STATE" \ - "$@" 3>&- || _e1=$? + "${HG2GIT_ARGS[@]}" 3>&- || _e1=$? echo $_e1 >&3 } | \ {