1313// --check turns on checking that the working tree matches the
1414// files that are being modified, but doesn't apply the patch
1515// --stat does just a diffstat, and doesn't actually apply
16- // --show-files shows the directory changes
1716// --index-info shows the old and new index info for paths if available.
1817//
1918static int check_index = 0 ;
@@ -22,11 +21,10 @@ static int diffstat = 0;
2221static int summary = 0 ;
2322static int check = 0 ;
2423static int apply = 1 ;
25- static int show_files = 0 ;
2624static int show_index_info = 0 ;
2725static int line_termination = '\n' ;
2826static const char apply_usage [] =
29- "git-apply [--stat] [--summary] [--check] [--index] [--apply] [--show-files] [-- index-info] [-z] <patch>..." ;
27+ "git-apply [--stat] [--summary] [--check] [--index] [--apply] [--index-info] [-z] <patch>..." ;
3028
3129/*
3230 * For "diff-stat" like behaviour, we keep track of the biggest change
@@ -1270,35 +1268,6 @@ static int check_patch_list(struct patch *patch)
12701268 return error ;
12711269}
12721270
1273- static void show_file (int c , unsigned int mode , const char * name )
1274- {
1275- printf ("%c %o %s\n" , c , mode , name );
1276- }
1277-
1278- static void show_file_list (struct patch * patch )
1279- {
1280- for (;patch ; patch = patch -> next ) {
1281- if (patch -> is_rename ) {
1282- show_file ('-' , patch -> old_mode , patch -> old_name );
1283- show_file ('+' , patch -> new_mode , patch -> new_name );
1284- continue ;
1285- }
1286- if (patch -> is_copy || patch -> is_new ) {
1287- show_file ('+' , patch -> new_mode , patch -> new_name );
1288- continue ;
1289- }
1290- if (patch -> is_delete ) {
1291- show_file ('-' , patch -> old_mode , patch -> old_name );
1292- continue ;
1293- }
1294- if (patch -> old_mode && patch -> new_mode && patch -> old_mode != patch -> new_mode ) {
1295- printf ("M %o:%o %s\n" , patch -> old_mode , patch -> new_mode , patch -> old_name );
1296- continue ;
1297- }
1298- printf ("M %o %s\n" , patch -> old_mode , patch -> old_name );
1299- }
1300- }
1301-
13021271static inline int is_null_sha1 (const unsigned char * sha1 )
13031272{
13041273 return !memcmp (sha1 , null_sha1 , 20 );
@@ -1675,9 +1644,6 @@ static int apply_patch(int fd)
16751644 die ("Unable to write new cachefile" );
16761645 }
16771646
1678- if (show_files )
1679- show_file_list (list );
1680-
16811647 if (show_index_info )
16821648 show_index_list (list );
16831649
@@ -1735,10 +1701,6 @@ int main(int argc, char **argv)
17351701 apply = 1 ;
17361702 continue ;
17371703 }
1738- if (!strcmp (arg , "--show-files" )) {
1739- show_files = 1 ;
1740- continue ;
1741- }
17421704 if (!strcmp (arg , "--index-info" )) {
17431705 apply = 0 ;
17441706 show_index_info = 1 ;
0 commit comments