Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73e0f97b authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

Minor refactor.

- cleanup local state before exiting,
- move cl upload to a separate function for readability.

Bug: 243966946
Test: run locally
Change-Id: If66d52168abc2e4878fe99255397d7432874e141
parent 46e28206
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -15,6 +15,17 @@ function revert_local_changes() {
        if [[ $previousHash ]]; then git revert --no-commit $previousHash ; fi ;'
}

function commit_changes() {
    repo forall -c '\
        if [[ $(git status --short) ]]; then
            repo start fina-step1 ;
            git add -A . ;
            git commit -m FINALIZATION_STEP_1_SCRIPT_COMMIT -m WILL_BE_AUTOMATICALLY_REVERTED ;
            repo upload --cbr --no-verify -t -y . ;
            git clean -fdx ; git reset --hard ;
        fi'
}

function finalize_step_1_main() {
    local top="$(dirname "$0")"/../..

@@ -26,7 +37,7 @@ function finalize_step_1_main() {
    source $top/build/make/finalize-aidl-vndk-sdk-resources.sh

    # move all changes to fina-step1 branch and commit with a robot message
    repo forall -c 'if [[ $(git status --short) ]]; then repo start fina-step1 ; git add -A . ; git commit -m FINALIZATION_STEP_1_SCRIPT_COMMIT -m WILL_BE_AUTOMATICALLY_REVERTED ; repo upload --cbr --no-verify -t -y . ; fi'
    commit_changes
}

finalize_step_1_main