It is briefly mentioned in the manpage, https://www.archlinux.org/pacman/PKGBUILD.5.html, but basically a pkgbuild can use a git repo as a source directly. Here's an example:
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=pacma...
Compare it to pacman's release-based pkgbuild:
https://git.archlinux.org/svntogit/packages.git/tree/trunk/P...
The major differences are the "git" url in the sources, the provides/conflicts metadata and the dynamic pkgver() function.