Skip to content

Commit

Permalink
Correctly handle loading of peeled/unpeeled refs (no idea how to test…
Browse files Browse the repository at this point in the history
… it)
  • Loading branch information
Ignas committed Aug 14, 2024
1 parent 024e28d commit 36af9d9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/lt/pow/nukagit/dfs/NukagitDfsRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ private Ref toJgitRef(HashMap<String, DfsRef> allRefMap, DfsRef dfsRef) {
if (dfsRef.isSymbolic()) {
DfsRef target = allRefMap.get(dfsRef.target());
return new SymbolicRef(dfsRef.name(), toJgitRef(allRefMap, target));
} else if (dfsRef.isPeeled()) {
if (dfsRef.peeledRef() == null) {
return new ObjectIdRef.PeeledNonTag(
Ref.Storage.LOOSE, dfsRef.name(), ObjectId.fromString(dfsRef.objectID()));

}
return new ObjectIdRef.PeeledTag(
Ref.Storage.LOOSE, dfsRef.name(), ObjectId.fromString(dfsRef.objectID()), ObjectId.fromString(dfsRef.peeledRef()));
}
return new ObjectIdRef.Unpeeled(
Ref.Storage.LOOSE, dfsRef.name(), ObjectId.fromString(dfsRef.objectID()));
Expand Down

0 comments on commit 36af9d9

Please sign in to comment.