| Summary: | RepositoryUtil.mapCommitToRef() not testing tags properly | ||
|---|---|---|---|
| Product: | [Technology] EGit | Reporter: | François Rey <eclipse.org> |
| Component: | Core | Assignee: | Project Inbox <egit.core-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | matthias.sohn |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
Code provided above was my custom groovy code.
Here's how the fix should look like in java
} else if (any instanceof RevCommit) {
RevCommit commit = ((RevCommit)any);
if (commit.toObjectId().name().equals(commitId)) {
RevCommit commit = ((RevCommit)any);
tagMap.put(tagRef.getName(), commit.getCommitterIdent().getWhen());
}
} // else ignore here
Could you contribute your patch in our Gerrit code review server as described in the contributor guide [1] ? [1] http://wiki.eclipse.org/EGit/Contributor_Guide#Contributing_Patches May I ask an existing egit developper to please do that instead? It would be easier overall because I have not setup my environment for egit development. I only copied part of the code form egit source plugin into my own groovy code, and fixed the bug in my own groovy project. Ok, I can do that for you, could you please confirm that you: a. authored 100% of the code b. have the rights to donate the content to Eclipse c. contribute the content under the EPL a. I have authored 100% of the code of this fix (which consist of one 'if' statement around a couple of existing lines) b. I have the rights to donate the content to Eclipse (I'm working for myself) c. I willingly contribute the content under the EPL Thanks! Which mail account should I use to identify you as author of this patch (this is used for user authentication in git commits), bugs.eclipse.org@XXXXXX.XXXXX sounds a bit strange to me ... Is it possible to remove my address from the above comment? Please let's continue this discussion by personal mail using that address for now. Actually this has been reported before by Bug 337967 and fixed with http://egit.eclipse.org/r/3544. Please mark this one as duplicate of 337967. *** This bug has been marked as a duplicate of bug 337967 *** |
Build Identifier: 0.11.3 In org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java Function mapCommitToRef 148 } else if (any instanceof RevCommit) { 149 RevCommit commit = ((RevCommit)any); 150 tagMap.put(tagRef.getName(), commit.getCommitterIdent().getWhen()); 151 } // else ignore here The above code snippet does not test if the found commit is equal to the given revision. Actual code should read: } else if (any instanceof RevCommit) { RevCommit commit = ((RevCommit)any); if (commit.toObjectId().name().equals(commitId)) { Date timestamp = commit.getCommitterIdent().getWhen() tagMap.put(tagRef.getName(), timestamp); Logger.debug " mapCommitToRemoteRef: found tag ${tagRef} = ${any}(RevCommit) at ${timestamp?.dateTimeString}" } } // else ignore here I've successfully used this fix in my own groovy script. Reproducible: Always