@@ -27,6 +27,7 @@ static enum { ABORT, VERBATIM, WARN, STRIP } signed_tag_mode = ABORT;
2727static enum { ERROR , DROP , REWRITE } tag_of_filtered_mode = ABORT ;
2828static int fake_missing_tagger ;
2929static int no_data ;
30+ static int full_tree ;
3031
3132static int parse_opt_signed_tag_mode (const struct option * opt ,
3233 const char * arg , int unset )
@@ -241,7 +242,8 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)
241242 message += 2 ;
242243
243244 if (commit -> parents &&
244- get_object_mark (& commit -> parents -> item -> object ) != 0 ) {
245+ get_object_mark (& commit -> parents -> item -> object ) != 0 &&
246+ !full_tree ) {
245247 parse_commit (commit -> parents -> item );
246248 diff_tree_sha1 (commit -> parents -> item -> tree -> object .sha1 ,
247249 commit -> tree -> object .sha1 , "" , & rev -> diffopt );
@@ -281,6 +283,8 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)
281283 i ++ ;
282284 }
283285
286+ if (full_tree )
287+ printf ("deleteall\n" );
284288 log_tree_diff_flush (rev );
285289 rev -> diffopt .output_format = saved_output_format ;
286290
@@ -584,6 +588,8 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
584588 "Import marks from this file" ),
585589 OPT_BOOLEAN (0 , "fake-missing-tagger" , & fake_missing_tagger ,
586590 "Fake a tagger when tags lack one" ),
591+ OPT_BOOLEAN (0 , "full-tree" , & full_tree ,
592+ "Output full tree for each commit" ),
587593 { OPTION_NEGBIT , 0 , "data" , & no_data , NULL ,
588594 "Skip output of blob data" ,
589595 PARSE_OPT_NOARG | PARSE_OPT_NEGHELP , NULL , 1 },
@@ -608,6 +614,9 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
608614 if (import_filename )
609615 import_marks (import_filename );
610616
617+ if (import_filename && revs .prune_data )
618+ full_tree = 1 ;
619+
611620 get_tags_and_duplicates (& revs .pending , & extra_refs );
612621
613622 if (prepare_revision_walk (& revs ))
0 commit comments