Meta/onemerge: clean temporary files correctly and exit non-zero upon failure

This commit is contained in:
Junio C Hamano
2026-07-21 12:23:37 -07:00
parent 5759148277
commit 26a198328d

View File

@@ -15,7 +15,7 @@ fi
tmp=/var/tmp/e.$$
rm -f "$tmp.1" "$tmp.2" &&
prev= &&
trap 'rm -f "$tmp.*"' 0 || exit
trap 'rm -f "$tmp."*' 0 || exit
git rev-list --merges --first-parent master..$endpoint |
while read commit
@@ -33,8 +33,7 @@ do
echo Merges multiple topics
git show -s --format="* %s" "$prev"
comm -23 "$tmp.1" "$tmp.2"
exit
exit 1
fi
fi
mv -f "$tmp.1" "$tmp.2"