Skip to content

Commit acdaf3f

Browse files
committed
umpf: support piping yes into umpf
When building or tagging an umpf, umpf can ask which branch to use when multiple are available. Piping yes(1) into umpf in this case doesn't work, because the variable populated by read in that case is left empty. Handle this case to reduce user confusion. Signed-off-by: Ahmad Fatoum <[email protected]>
1 parent a3616f4 commit acdaf3f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

umpf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,10 @@ find_branch_rev() {
445445
i=$((i+1))
446446
done
447447
read -e -i ${def} -p "branch number: " i
448+
# if yes(1) is piped in, i is not populated
449+
if [ -z "$i" ]; then
450+
i="${def}"
451+
fi
448452
nice_branch "${branches[$i]}"
449453
remote="${replies[1]:-refs/heads}/"
450454
if [ -z "${GIT_REMOTE}" ]; then

0 commit comments

Comments
 (0)