Skip to content

Commit 0d2740e

Browse files
committed
inline missed_owners
1 parent 22744eb commit 0d2740e

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

src/bkg.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ main() {
112112
opted_out=$(wc -l <"$BKG_OPTOUT")
113113
opted_out_before=$(get_BKG BKG_OUT)
114114
fast_out=$([ "$GITHUB_OWNER" = "ipitio" ] && [ -n "$opted_out_before" ] && (( opted_out_before < opted_out )) && echo "true" || echo "false")
115-
set -x
115+
116116
if [ "$BKG_MODE" -ne 2 ]; then
117117
if [ "$BKG_MODE" -eq 0 ] || [ "$BKG_MODE" -eq 3 ]; then
118118
if $fast_out; then
@@ -141,7 +141,14 @@ set -x
141141
mv "$connections".bak "$connections"
142142

143143
echo "$(
144-
missed_owners
144+
if pushd "$BKG_INDEX_DIR" >/dev/null 2>&1; then
145+
git ls-tree -r --name-only "$BKG_INDEX" ./ \
146+
| xargs -r -I filename git log -1 --format='%cs filename' filename \
147+
| awk -v cutoff="$(get_BKG BKG_BATCH_FIRST_STARTED)" 'cutoff != "" && $1 < cutoff {print}' \
148+
| sort | grep -oP '(?<= )[^/]+(?=/)' | uniq | awk '{print "0/"$1}'
149+
popd >/dev/null 2>&1 || return
150+
fi
151+
145152
cat "$BKG_OWNERS"
146153
)" >"$BKG_OWNERS"
147154

src/lib/util.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -661,14 +661,4 @@ clean_owners() {
661661
awk '!seen[$0]++' "$1" >"$temp_file" && cp -f "$temp_file" "$1"
662662
}
663663

664-
missed_owners() {
665-
pushd "$BKG_INDEX_DIR" >/dev/null 2>&1 || return
666-
cutoff=$(get_BKG BKG_BATCH_FIRST_STARTED)
667-
git ls-tree -r --name-only "$BKG_INDEX" ./ \
668-
| xargs -r -I filename git log -1 --format='%cs filename' filename \
669-
| awk -v cutoff="$cutoff" 'cutoff != "" && $1 < cutoff {print}' \
670-
| sort | grep -oP '(?<= )[^/]+(?=/)' | uniq | awk '{print "0/"$1}'
671-
popd >/dev/null 2>&1 || return
672-
}
673-
674664
set +o allexport

0 commit comments

Comments
 (0)