In reality, checking sources, git output is not buffered by less all the time.
Checking pager.c, it shows git output is buffered by the program pointed to the PAGER shell variable; if it is not defined, less will be used by omission.
More interestingly yet, while the less output is being paged, it sets the shell GIT_PAGER_IN_USE variable to true. When invoking the pager, it checks for that variable.
As an oddity, it seems it does not like
cat as a pager, if it detects it, it blanks it out.
#define DEFAULT_PAGER "less"
const char *pager = git_pager(isatty(1));
* After we redirect standard output, we won't be able to use an ioctl
* to get the terminal size. Let's grab it now, and then set $COLUMNS
* to communicate it to any sub-processes.
xsnprintf(buf, sizeof(buf), "%d", term_columns());
setenv("COLUMNS", buf, 0);
setenv("GIT_PAGER_IN_USE", "true", 1);
/* spawn the pager */
pager_process.in = -1;
/* original process continues, but writes to the pipe */
/* this makes sure that the parent terminates after the pager */