]> Untitled Git - hvutilities.git/commitdiff
hvsp: fix bug when grepping branch names
authorHugo Villeneuve <hugo@hugovil.com>
Mon, 23 Mar 2026 20:30:14 +0000 (16:30 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Tue, 24 Mar 2026 16:27:37 +0000 (12:27 -0400)
As an example, when serching for non-existent branch named mybranch,
mybranch.orig would match, and result in an error trying to erase
non-existent branch mybranch.

Fix by matching to the end of the line "$".

Signed-off-by: Hugo Villeneuve <hugo@hugovil.com>
scripts/kernel-send-patches.sh

index d7b34ef47fa03d3646a87f435a0cc50f8f1695be..75b0cc92e5a425d5a046bf440ffa084048299c9e 100755 (executable)
@@ -313,7 +313,7 @@ else
     patches_branch="b4/${name}"
 fi
 
-if git branch | grep -q ${patches_branch}; then
+if git branch | grep -q -e "${patches_branch}$"; then
     git branch -D ${patches_branch} 1>/dev/null
 fi
 
@@ -433,7 +433,7 @@ EOF
     # Create temporary branch for compilation, based on compile_branch:
     temp_compile_branch="${patches_branch}_compile"
 
-    if git branch | grep -q ${temp_compile_branch}; then
+    if git branch | grep -q -e "${temp_compile_branch}$"; then
         git branch -D ${temp_compile_branch}
     fi