From 60ed26438c909fd273528e67b399ee6ca4028e1e Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Sun, 20 Apr 2014 13:59:28 -0500 Subject: fast-export: add support to delete refs Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- builtin/fast-export.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'builtin') diff --git a/builtin/fast-export.c b/builtin/fast-export.c index ad9c17e8e7..ef4481615f 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -673,6 +673,19 @@ static void import_marks(char *input_file) fclose(f); } +static void handle_deletes(void) +{ + int i; + for (i = 0; i < refspecs_nr; i++) { + struct refspec *refspec = &refspecs[i]; + if (*refspec->src) + continue; + + printf("reset %s\nfrom %s\n\n", + refspec->dst, sha1_to_hex(null_sha1)); + } +} + int cmd_fast_export(int argc, const char **argv, const char *prefix) { struct rev_info revs; @@ -764,6 +777,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) } handle_tags_and_duplicates(); + handle_deletes(); if (export_filename && lastimportid != last_idnum) export_marks(export_filename); -- cgit v1.2.3