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.

39 lines
1.1KB

  1. #ifndef REPLACE_OBJECT_H
  2. #define REPLACE_OBJECT_H
  3. #include "oidmap.h"
  4. #include "repository.h"
  5. #include "object-store.h"
  6. struct replace_object {
  7. struct oidmap_entry original;
  8. struct object_id replacement;
  9. };
  10. void prepare_replace_object(struct repository *r);
  11. /*
  12. * This internal function is only declared here for the benefit of
  13. * lookup_replace_object(). Please do not call it directly.
  14. */
  15. const struct object_id *do_lookup_replace_object(struct repository *r,
  16. const struct object_id *oid);
  17. /*
  18. * If object sha1 should be replaced, return the replacement object's
  19. * name (replaced recursively, if necessary). The return value is
  20. * either sha1 or a pointer to a permanently-allocated value. When
  21. * object replacement is suppressed, always return sha1.
  22. */
  23. static inline const struct object_id *lookup_replace_object(struct repository *r,
  24. const struct object_id *oid)
  25. {
  26. if (!read_replace_refs ||
  27. (r->objects->replace_map &&
  28. r->objects->replace_map->map.tablesize == 0))
  29. return oid;
  30. return do_lookup_replace_object(r, oid);
  31. }
  32. #endif /* REPLACE_OBJECT_H */