diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2019-03-12 22:35:59 -0400 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2019-03-12 22:38:11 -0400 |
commit | 925564a0653486f4076de06e2498bf75bb9f2f85 (patch) | |
tree | 361cb0011c0757c71615ff9f77d9a71c6ffa9679 | |
parent | 53ab906c8ecdbfc204887b20f8ed157caf4e0314 (diff) | |
download | librebootfr-925564a0653486f4076de06e2498bf75bb9f2f85.tar.gz librebootfr-925564a0653486f4076de06e2498bf75bb9f2f85.zip |
libs/git: Create branch name based on argument list
There was a bug where only $project was used as the branch name due to
some faulty logic which checked for the existence of a revision file
before setting the variables "prepare_branch" and "prepare_path".
The bug in this case was that prepare_branch would be set to the value
of $branch in only the first iteration of the for loop since in almost
all cases there is only one revision file that exists for a given
project, regardless of the arguments provided. Explained another way,
in order for the proper branch name to be used a revision file would
have had to exist in every target directory.
This was an issue because only one branch was ever operated on (named
$project), meaning if actions were performed on many targets then only
the last to run would be represented in the project's
repository--making tracking down some bugs a bit harder.
With this fixed we now create a branch for every possible project
or tool configuration and leaves us with a log for each.
-rwxr-xr-x | libs/git | 20 |
1 files changed, 2 insertions, 18 deletions
@@ -344,13 +344,6 @@ git_project_prepare_patch() { branch="$branch-$argument" fi - local revision_path="$configs_path/$path/$REVISION" - - if ! [[ -f "$revision_path" ]] - then - continue - fi - prepare_branch=$branch prepare_path=$path done @@ -392,13 +385,11 @@ git_project_prepare_revision() { local revision_path="$configs_path/$path/$REVISION" - if ! [[ -f "$revision_path" ]] - then - continue + if [[ -f $revision_path ]]; then + prepare_revision=$(< "$revision_path") fi prepare_branch=$branch - prepare_revision=$(cat "$revision_path") done if [[ -n "$prepare_branch" ]] @@ -435,13 +426,6 @@ git_project_prepare_check() { branch="$branch-$argument" fi - local revision_path="$configs_path/$path/$REVISION" - - if ! [[ -f "$revision_path" ]] - then - continue - fi - prepare_branch=$branch done |