@@ -1801,29 +1801,36 @@ static void wt_longstatus_print(struct wt_status *s)
1801
1801
; /* nothing */
1802
1802
else if (s -> workdir_dirty ) {
1803
1803
if (s -> hints )
1804
- printf (_ ("no changes added to commit "
1805
- "(use \"git add\" and/or \"git commit -a\")\n" ));
1804
+ fprintf (s -> fp , _ ("no changes added to commit "
1805
+ "(use \"git add\" and/or "
1806
+ "\"git commit -a\")\n" ));
1806
1807
else
1807
- printf (_ ("no changes added to commit\n" ));
1808
+ fprintf (s -> fp , _ ("no changes added to "
1809
+ "commit\n" ));
1808
1810
} else if (s -> untracked .nr ) {
1809
1811
if (s -> hints )
1810
- printf (_ ("nothing added to commit but untracked files "
1811
- "present (use \"git add\" to track)\n" ));
1812
+ fprintf (s -> fp , _ ("nothing added to commit but "
1813
+ "untracked files present (use "
1814
+ "\"git add\" to track)\n" ));
1812
1815
else
1813
- printf (_ ("nothing added to commit but untracked files present\n" ));
1816
+ fprintf (s -> fp , _ ("nothing added to commit but "
1817
+ "untracked files present\n" ));
1814
1818
} else if (s -> is_initial ) {
1815
1819
if (s -> hints )
1816
- printf (_ ("nothing to commit (create/copy files "
1817
- "and use \"git add\" to track)\n" ));
1820
+ fprintf (s -> fp , _ ("nothing to commit (create/"
1821
+ "copy files and use \"git "
1822
+ "add\" to track)\n" ));
1818
1823
else
1819
- printf ( _ ("nothing to commit\n" ));
1824
+ fprintf ( s -> fp , _ ("nothing to commit\n" ));
1820
1825
} else if (!s -> show_untracked_files ) {
1821
1826
if (s -> hints )
1822
- printf (_ ("nothing to commit (use -u to show untracked files)\n" ));
1827
+ fprintf (s -> fp , _ ("nothing to commit (use -u to "
1828
+ "show untracked files)\n" ));
1823
1829
else
1824
- printf ( _ ("nothing to commit\n" ));
1830
+ fprintf ( s -> fp , _ ("nothing to commit\n" ));
1825
1831
} else
1826
- printf (_ ("nothing to commit, working tree clean\n" ));
1832
+ fprintf (s -> fp , _ ("nothing to commit, working tree "
1833
+ "clean\n" ));
1827
1834
}
1828
1835
if (s -> show_stash )
1829
1836
wt_longstatus_print_stash_summary (s );
@@ -1846,12 +1853,12 @@ static void wt_shortstatus_unmerged(struct string_list_item *it,
1846
1853
}
1847
1854
color_fprintf (s -> fp , color (WT_STATUS_UNMERGED , s ), "%s" , how );
1848
1855
if (s -> null_termination ) {
1849
- fprintf (stdout , " %s%c" , it -> string , 0 );
1856
+ fprintf (s -> fp , " %s%c" , it -> string , 0 );
1850
1857
} else {
1851
1858
struct strbuf onebuf = STRBUF_INIT ;
1852
1859
const char * one ;
1853
1860
one = quote_path (it -> string , s -> prefix , & onebuf );
1854
- printf ( " %s\n" , one );
1861
+ fprintf ( s -> fp , " %s\n" , one );
1855
1862
strbuf_release (& onebuf );
1856
1863
}
1857
1864
}
@@ -1864,37 +1871,37 @@ static void wt_shortstatus_status(struct string_list_item *it,
1864
1871
if (d -> index_status )
1865
1872
color_fprintf (s -> fp , color (WT_STATUS_UPDATED , s ), "%c" , d -> index_status );
1866
1873
else
1867
- putchar (' ' );
1874
+ fputc (' ' , s -> fp );
1868
1875
if (d -> worktree_status )
1869
1876
color_fprintf (s -> fp , color (WT_STATUS_CHANGED , s ), "%c" , d -> worktree_status );
1870
1877
else
1871
- putchar (' ' );
1872
- putchar (' ' );
1878
+ fputc (' ' , s -> fp );
1879
+ fputc (' ' , s -> fp );
1873
1880
if (s -> null_termination ) {
1874
- fprintf (stdout , "%s%c" , it -> string , 0 );
1881
+ fprintf (s -> fp , "%s%c" , it -> string , 0 );
1875
1882
if (d -> rename_source )
1876
- fprintf (stdout , "%s%c" , d -> rename_source , 0 );
1883
+ fprintf (s -> fp , "%s%c" , d -> rename_source , 0 );
1877
1884
} else {
1878
1885
struct strbuf onebuf = STRBUF_INIT ;
1879
1886
const char * one ;
1880
1887
1881
1888
if (d -> rename_source ) {
1882
1889
one = quote_path (d -> rename_source , s -> prefix , & onebuf );
1883
1890
if (* one != '"' && strchr (one , ' ' ) != NULL ) {
1884
- putchar ('"' );
1891
+ fputc ('"' , s -> fp );
1885
1892
strbuf_addch (& onebuf , '"' );
1886
1893
one = onebuf .buf ;
1887
1894
}
1888
- printf ( "%s -> " , one );
1895
+ fprintf ( s -> fp , "%s -> " , one );
1889
1896
strbuf_release (& onebuf );
1890
1897
}
1891
1898
one = quote_path (it -> string , s -> prefix , & onebuf );
1892
1899
if (* one != '"' && strchr (one , ' ' ) != NULL ) {
1893
- putchar ('"' );
1900
+ fputc ('"' , s -> fp );
1894
1901
strbuf_addch (& onebuf , '"' );
1895
1902
one = onebuf .buf ;
1896
1903
}
1897
- printf ( "%s\n" , one );
1904
+ fprintf ( s -> fp , "%s\n" , one );
1898
1905
strbuf_release (& onebuf );
1899
1906
}
1900
1907
}
@@ -1903,13 +1910,13 @@ static void wt_shortstatus_other(struct string_list_item *it,
1903
1910
struct wt_status * s , const char * sign )
1904
1911
{
1905
1912
if (s -> null_termination ) {
1906
- fprintf (stdout , "%s %s%c" , sign , it -> string , 0 );
1913
+ fprintf (s -> fp , "%s %s%c" , sign , it -> string , 0 );
1907
1914
} else {
1908
1915
struct strbuf onebuf = STRBUF_INIT ;
1909
1916
const char * one ;
1910
1917
one = quote_path (it -> string , s -> prefix , & onebuf );
1911
1918
color_fprintf (s -> fp , color (WT_STATUS_UNTRACKED , s ), "%s" , sign );
1912
- printf ( " %s\n" , one );
1919
+ fprintf ( s -> fp , " %s\n" , one );
1913
1920
strbuf_release (& onebuf );
1914
1921
}
1915
1922
}
0 commit comments