]> git.ozlabs.org Git - next-scripts/commitdiff
move check_unmerged_files into do_merge
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 21 Aug 2025 02:37:32 +0000 (12:37 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 21 Aug 2025 02:37:32 +0000 (12:37 +1000)
That is only place it is used

common.sh
do_merge

index 0e886807eee77a415162c5fe75e2b97f69998979..f0c93f18b72c4d02d530a21bea38f716303dc97b 100644 (file)
--- a/common.sh
+++ b/common.sh
@@ -118,23 +118,4 @@ get_build_flag()
        get_control_field "$1" 6
 }
 
-check_unmerged_files()
-{
-       # "In POSIX sh, 'local' is undefined."
-       # shellcheck disable=SC3043
-       local tree="$1"
-       # shellcheck disable=SC3043
-       local um_files
-       # shellcheck disable=SC3043
-       local rm_files
-
-       um_files=$(git diff 2>&1 | sed -n 's/^\* Unmerged path //p')
-       if [ "$um_files" ] && [ -f "../merge-files/$tree" ]; then
-               rm_files=$(grep -F "$um_files" "../merge-files/$tree")
-               if [ "$rm_files" ]; then
-                       "$bin_dir/do_rm" "$rm_files"
-               fi
-       fi
-}
-
 true
index 509b7c5c3cd57dcb030ebb18b848958fc09a3e0a..85320d0c5b0cf2197636cb40879be7476c249826 100755 (executable)
--- a/do_merge
+++ b/do_merge
@@ -58,6 +58,23 @@ fix_up()
        fi
 }
 
+check_unmerged_files()
+{
+       # "In POSIX sh, 'local' is undefined."
+       # shellcheck disable=SC3043
+       local tree um_files rm_files
+
+       tree="$1"
+
+       um_files=$(git diff 2>&1 | sed -n 's/^\* Unmerged path //p')
+       if [ "$um_files" ] && [ -f "../merge-files/$tree" ]; then
+               rm_files=$(grep -F "$um_files" "../merge-files/$tree")
+               if [ "$rm_files" ]; then
+                       "$bin_dir/do_rm" "$rm_files"
+               fi
+       fi
+}
+
 if [ -f "$SHA1_FILE" ]; then
        previous_tree=$(tail -n1 "$SHA1_FILE" | cut -f1 -d"$_TAB")
 elif [ -z "$start_from" ]; then