()
| 31 | private String id; |
| 32 | |
| 33 | @Override |
| 34 | public void run() { |
| 35 | Map<String, List<String>> refValueName = new HashMap<>(8); |
| 36 | |
| 37 | final List<RefObject> refObjects = ZitContext.iteratorRefs(); |
| 38 | refObjects.forEach(refObject -> { |
| 39 | final String refName = refObject.getRefName(); |
| 40 | final String value = refObject.getRefValue().getValue(); |
| 41 | refValueName.putIfAbsent(value, new ArrayList<>()); |
| 42 | final List<String> existRefNames = refValueName.get(value); |
| 43 | existRefNames.add(refName); |
| 44 | }); |
| 45 | |
| 46 | |
| 47 | // if no args, set HEAD |
| 48 | // else use tag or hash as object id |
| 49 | final List<String> idList = ZitContext.iteratorCommitsAndParents(Collections.singletonList(id)); |
| 50 | idList.forEach(objectId -> { |
| 51 | CommitObject commit = Commit.getCommit(objectId); |
| 52 | final List<String> refNames = refValueName.getOrDefault(objectId, Collections.emptyList()); |
| 53 | printCommit(objectId, commit, refNames); |
| 54 | }); |
| 55 | } |
| 56 | |
| 57 | public static void printCommit(String objectId, CommitObject commit) { |
| 58 | printCommit(objectId, commit, Collections.emptyList()); |
nothing calls this directly
no test coverage detected