From 925564a0653486f4076de06e2498bf75bb9f2f85 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Tue, 12 Mar 2019 22:35:59 -0400 Subject: 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. --- libs/git | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/libs/git b/libs/git index 3d9facee..48499921 100755 --- a/libs/git +++ b/libs/git @@ -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 -- cgit v1.2.3-70-g09d2