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.
724
724
waiting for someone with sufficient permissions to fix it.
725
725
726
726
`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
729
728
as 'git blame' (in incremental mode), 'git rev-list', 'git log',
730
729
'git check-attr' and 'git check-ignore' will
731
730
force a flush of the output stream after each record have been
732
731
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
734
733
using completely buffered I/O. If this environment variable is
735
734
not set, Git will choose buffered or record-oriented flushing
736
735
based on whether stdout appears to be redirected to a file or not.
Original file line number Diff line number Diff line change 19
19
void maybe_flush_or_die (FILE * f , const char * desc )
20
20
{
21
21
static int skip_stdout_flush = -1 ;
22
- struct stat st ;
23
- char * cp ;
24
22
25
23
if (f == stdout ) {
26
24
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
+ }
36
33
}
37
34
if (skip_stdout_flush && !ferror (f ))
38
35
return ;
You can’t perform that action at this time.
0 commit comments