uhh... maybe sth like this:
```
#!/bin/sh
dir="$1"
if ! [ -d "$dir" ]; then
echo "not a directory: $dir" >&2
fi
user=$(stat --printf="%U" "$dir")
exec sudo -u "$user" /usr/bin/git-upload-pack "$@"
```
and then
git fetch --upload-pack=~/bin/sudo-upload-pack <remote>
but the part about automagically figuring out the user feels sus to me...