From: Stephen Rothwell Date: Thu, 19 Jan 2023 20:28:08 +0000 (+1100) Subject: do_merge: just assume an existing SHA1s file means continue X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=58e61f1e744f8272a08d78f8a1c8e01047dce443;p=next-scripts do_merge: just assume an existing SHA1s file means continue --- diff --git a/do_merge b/do_merge index c3d3ead..a14b51e 100755 --- a/do_merge +++ b/do_merge @@ -2,14 +2,9 @@ no_build=false start_from="" -do_continue=false -while getopts 'cns:' opt; do +while getopts 'ns:' opt; do case "$opt" in - c) - do_continue=true - ;; - n) no_build=true ;; @@ -53,9 +48,13 @@ fix_up() fi } -if $do_continue; then +if [ -f "$SHA1_FILE" ]; then last=$(tail -n1 "$SHA1_FILE" | cut -f1 -d"$_TAB") start_from=$(get_branches | sed -n '/^'"$last"'$/{n;p;}') + if [ -z "$start_from" ]; then + printf '%s: %s exists but cannot find next tree\n' "$0" "$SHA1_FILE" 1>&2 + exit 1 + fi fi if [ -z "$start_from" ]; then cp /dev/null "$LOG_FILE"