finalization: use same repo branch during dry-run

Teach step-*.sh to re-use the same branch name if running in dry-run
mode. This is useful for running the steps sequentially: if using
different branch names, each 'repo start' will undo the changes created
during the previous step-*.sh.

Bug: 323940469
Test: croot && build/tools/finalization/step-1.sh --dry-run && build/tools/finalization/step-2.sh --dry-run
Ignore-AOSP-first: VIC finalization happens outside AOSP
Change-Id: I720f294f6abf5a8b276bb30f8c531fcbea749b76
diff --git a/tools/finalization/step-2.sh b/tools/finalization/step-2.sh
index 862c8f5..52e3887 100755
--- a/tools/finalization/step-2.sh
+++ b/tools/finalization/step-2.sh
@@ -4,7 +4,7 @@
 function commit_step_2_changes() {
     repo forall -c '\
         if [[ $(git status --short) ]]; then
-            repo start "$FINAL_PLATFORM_CODENAME-SDK-Finalization-Rel" ;
+            repo start "'$repo_branch'" ;
             git add -A . ;
             git commit -m "$FINAL_PLATFORM_CODENAME/$FINAL_PLATFORM_SDK_VERSION is now REL" \
                        -m "Ignore-AOSP-First: $FINAL_PLATFORM_CODENAME Finalization
@@ -17,8 +17,9 @@
 
 function finalize_step_2_main() {
     local top="$(dirname "$0")"/../../../..
-    source $top/build/make/tools/finalization/command-line-options.sh
     source $top/build/make/tools/finalization/environment.sh
+    local repo_branch="$FINAL_PLATFORM_CODENAME-SDK-Finalization-Rel"
+    source $top/build/make/tools/finalization/command-line-options.sh
 
     # prebuilts etc
     source $top/build/make/tools/finalization/finalize-sdk-rel.sh