diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2019-12-09 08:09:55 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2019-12-13 09:54:24 +0000 |
commit | 5fbee305f8d7336eb21ca25581f9e4c168bd8f56 (patch) | |
tree | 0073b42eb6f3dc4c4e278cf17b6c6500e60a6070 /round-robin.sh | |
parent | 6b3212ace88742231411a6baf453f6435a65502c (diff) |
round-robin.sh: Re-arrange code in update_baseline()
... to make conditional logic easier to read.
Change-Id: Ie5dc7dae0b3e7762365b2585e2f627d88f1de27a
Diffstat (limited to 'round-robin.sh')
-rw-r--r-- | round-robin.sh | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/round-robin.sh b/round-robin.sh index 363924e9..faa3e471 100644 --- a/round-robin.sh +++ b/round-robin.sh @@ -592,9 +592,18 @@ update_baseline () local amend="" local rebase_head rebase_tail - if [ x"${rr[update_baseline]}" = x"push" ]; then + + if [ x"${rr[update_baseline]}" = x"init" ]; then + amend="--amend" + elif [ x"${rr[update_baseline]}" = x"push" ]; then : - elif [ x"${rr[update_baseline]}" != x"rebase" ]; then + elif [ x"${rr[update_baseline]}" = x"rebase" ]; then + rebase_head=$(git -C base-artifacts rev-parse HEAD) + rebase_tail=$(git -C base-artifacts rev-list --max-parents=0 HEAD) + git -C base-artifacts reset --hard $rebase_tail + amend="--amend" + else + # ${rr[update_baseline]} == update, reset local prev_head="" # We discard baseline entries for results worse or same than @@ -627,11 +636,6 @@ update_baseline () if [ x"$prev_head" != x"" ]; then git -C base-artifacts reset --hard $prev_head fi - else - rebase_head=$(git -C base-artifacts rev-parse HEAD) - rebase_tail=$(git -C base-artifacts rev-list --max-parents=0 HEAD) - git -C base-artifacts reset --hard $rebase_tail - amend="--amend" fi # Rsync current artifacts. Make sure to use -I rsync option since |