Merge branch 'main' into fix/bug-with-renames

This commit is contained in:
Tonye Jack 2022-05-14 18:39:10 -04:00 committed by GitHub
commit 4a7ed1cd68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,24 +31,6 @@ function get_diff() {
git diff --diff-filter="$filter" --name-only --ignore-submodules=all "$base" "$sha"
}
function get_renames() {
base="$1"
sha="$2"
while IFS='' read -r sub; do
sub_commit_pre="$(git diff "$base" "$sha" -- "$sub" | grep '^[-]Subproject commit' | awk '{print $3}')"
sub_commit_cur="$(git diff "$base" "$sha" -- "$sub" | grep '^[+]Subproject commit' | awk '{print $3}')"
if [ -n "$sub_commit_cur" ]; then
(
cd "$sub" && (
# the strange magic number is a hardcoded "empty tree" commit sha
get_renames "${sub_commit_pre:-4b825dc642cb6eb9a060e54bf8d69288fbee4904}" "${sub_commit_cur}" | awk -v r="$sub" '{ print "" r "/" $0}'
)
)
fi
done < <(git submodule | awk '{print $2}')
git log --name-status --ignore-submodules=all "$base" "$sha" | grep -E "^R" | awk -F '\t' -v d="$INPUT_OLD_NEW_SEPARATOR" '{print $2d$3}'
}
function get_renames() {
base="$1"
sha="$2"