Files
scripts/aosp-merger/prepare-commit-msg
Michael W 50d5f8aa37 scripts: Make REUSE compliant
Test: pipx run reuse lint
Change-Id: I73a60c421ec2d4399d511043e92d387dc890eb3d
2024-02-25 18:01:11 +02:00

18 lines
530 B
Bash

#!/bin/sh
# SPDX-FileCopyrightText: 2023 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
case "$2,$3" in
merge,)
if grep -q "# It looks like you may be committing a merge." "$1"; then
sed -i -e '/# ------------------------ >8 ------------------------/,+3d' "$1"
/usr/bin/perl -i.bak -ne 's/^#// if /^# Conflicts/ .. /^#\R/; print' "$1"
sed -i '/ It looks like you may be committing a merge./i # ------------------------ >8 ------------------------' "$1"
fi
;;
*)
;;
esac