]> git.ozlabs.org Git - next-scripts/commitdiff
do_merge: just assume an existing SHA1s file means continue
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 19 Jan 2023 20:28:08 +0000 (07:28 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 19 Jan 2023 20:28:08 +0000 (07:28 +1100)
do_merge

index c3d3ead957b03516945ffe55747a812e65d33177..a14b51ec4197809698c5e7180596370c08f57f7c 100755 (executable)
--- 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"