File tree Expand file tree Collapse file tree 2 files changed +10
-14
lines changed
Expand file tree Collapse file tree 2 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -724,13 +724,12 @@ for further details.
724724 waiting for someone with sufficient permissions to fix it.
725725
726726`GIT_FLUSH`::
727- // NEEDSWORK: make it into a usual Boolean environment variable
728- If this environment variable is set to "1", then commands such
727+ If this Boolean environment variable is set to true, then commands such
729728 as 'git blame' (in incremental mode), 'git rev-list', 'git log',
730729 'git check-attr' and 'git check-ignore' will
731730 force a flush of the output stream after each record have been
732731 flushed. If this
733- variable is set to "0" , the output of these commands will be done
732+ variable is set to false , the output of these commands will be done
734733 using completely buffered I/O. If this environment variable is
735734 not set, Git will choose buffered or record-oriented flushing
736735 based on whether stdout appears to be redirected to a file or not.
Original file line number Diff line number Diff line change 1919void maybe_flush_or_die (FILE * f , const char * desc )
2020{
2121 static int skip_stdout_flush = -1 ;
22- struct stat st ;
23- char * cp ;
2422
2523 if (f == stdout ) {
2624 if (skip_stdout_flush < 0 ) {
27- /* NEEDSWORK: make this a normal Boolean */
28- cp = getenv ("GIT_FLUSH" );
29- if (cp )
30- skip_stdout_flush = (atoi (cp ) == 0 );
31- else if ((fstat (fileno (stdout ), & st ) == 0 ) &&
32- S_ISREG (st .st_mode ))
33- skip_stdout_flush = 1 ;
34- else
35- skip_stdout_flush = 0 ;
25+ skip_stdout_flush = git_env_bool ("GIT_FLUSH" , -1 );
26+ if (skip_stdout_flush < 0 ) {
27+ struct stat st ;
28+ if (fstat (fileno (stdout ), & st ))
29+ skip_stdout_flush = 0 ;
30+ else
31+ skip_stdout_flush = S_ISREG (st .st_mode );
32+ }
3633 }
3734 if (skip_stdout_flush && !ferror (f ))
3835 return ;
You can’t perform that action at this time.
0 commit comments