Skip to content

Commit

Permalink
umpf: Fix topicless tag creation
Browse files Browse the repository at this point in the history
Calling umpf tag on an useries without topics aborts with the following
error message before creating the final octopus commit and the tags:

  /usr/bin/umpf: line 1129: .git/umpf/topics: No such file or directory

Fix this by allowing an empty topic list (or non-existent
.git/umpf/topics state) during umpf tag.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
  • Loading branch information
pH5 committed Jul 4, 2024
1 parent c2580a2 commit 7f0632d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion umpf
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,7 @@ Upstream-Status: Inappropriate [autogenerated]"
create_tag() {
local args tagname parents tree topic
local -a topics
if [ ! -e "${STATE}/tag" ]; then
return
Expand All @@ -1290,7 +1291,8 @@ create_tag() {
fi
tree="$(${GIT} log -1 --format="%T")"
for topic in $(<"${STATE}/topics"); do
mapfile -t topics < <(cat ${STATE}/topics 2>/dev/null)
for topic in "${topics[@]}"; do
parents="${parents} -p ${topic}"
done
commit=$(${GIT} commit-tree "${tree}" -p HEAD ${parents} -m "${tagname}" -F "${STATE}/series.next")
Expand Down

0 comments on commit 7f0632d

Please sign in to comment.