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.

ObjectToCommitData.java 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (C) 2021, Tencent.
  3. *
  4. * This program and the accompanying materials are made available under the
  5. * terms of the Eclipse Distribution License v. 1.0 which is available at
  6. * https://www.eclipse.org/org/documents/edl-v10.php.
  7. *
  8. * SPDX-License-Identifier: BSD-3-Clause
  9. */
  10. package org.eclipse.jgit.internal.storage.commitgraph;
  11. import org.eclipse.jgit.lib.AnyObjectId;
  12. import org.eclipse.jgit.lib.CommitGraph;
  13. import org.eclipse.jgit.lib.ObjectIdOwnerMap;
  14. /**
  15. * Per-object state used by
  16. * {@link org.eclipse.jgit.internal.storage.commitgraph.CommitGraphWriter}
  17. */
  18. class ObjectToCommitData extends ObjectIdOwnerMap.Entry {
  19. private int generation = CommitGraph.GENERATION_NUMBER_ZERO;
  20. private int oidPosition = -1;
  21. /**
  22. * Initialize this entry with a specific ObjectId.
  23. *
  24. * @param id
  25. * the id the entry represents.
  26. */
  27. ObjectToCommitData(AnyObjectId id) {
  28. super(id);
  29. }
  30. int getGeneration() {
  31. return generation;
  32. }
  33. void setGeneration(int generation) {
  34. this.generation = generation;
  35. }
  36. int getOidPosition() {
  37. return oidPosition;
  38. }
  39. void setOidPosition(int oidPosition) {
  40. this.oidPosition = oidPosition;
  41. }
  42. }