THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Git Source Code Mirror - This is a publish-only repository and all pull requests are ignored. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
git
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
660B

  1. #include "cache.h"
  2. #include "commit.h"
  3. #include "revision.h"
  4. #include "interdiff.h"
  5. static struct strbuf *idiff_prefix_cb(struct diff_options *opt, void *data)
  6. {
  7. return data;
  8. }
  9. void show_interdiff(struct rev_info *rev, int indent)
  10. {
  11. struct diff_options opts;
  12. struct strbuf prefix = STRBUF_INIT;
  13. memcpy(&opts, &rev->diffopt, sizeof(opts));
  14. opts.output_format = DIFF_FORMAT_PATCH;
  15. opts.output_prefix = idiff_prefix_cb;
  16. strbuf_addchars(&prefix, ' ', indent);
  17. opts.output_prefix_data = &prefix;
  18. diff_setup_done(&opts);
  19. diff_tree_oid(rev->idiff_oid1, rev->idiff_oid2, "", &opts);
  20. diffcore_std(&opts);
  21. diff_flush(&opts);
  22. strbuf_release(&prefix);
  23. }