From 84b7cb118370462f213b0a58dc92f48cb276b7ca Mon Sep 17 00:00:00 2001 From: Mykola Nikishov Date: Sun, 18 Oct 2009 07:14:24 +0300 Subject: [PATCH] Make a comment which describes a precondition public As user responsibile to assert that parameter which is passed to this method is valid it is reasonable to make this info available in a documentation. Change-Id: I6f6cd55a482cff769a5059c8e8362ce2102b5f3c Signed-off-by: Mykola Nikishov Signed-off-by: Shawn O. Pearce --- .../src/org/eclipse/egit/core/project/RepositoryMapping.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryMapping.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryMapping.java index 2b7e874b..a9808a2e 100644 --- a/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryMapping.java +++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryMapping.java @@ -198,15 +198,15 @@ public class RepositoryMapping { } /** + * This method should only be called for resources that are actually in this + * repository, so we can safely assume that their path prefix matches + * {@link #getWorkDir()}. Testing that here is rather expensive so we don't + * bother. + * * @param rsrc * @return the path relative to the Git repository, including base name. */ public String getRepoRelativePath(final IResource rsrc) { - // We should only be called for resources that are actually - // in this repository, so we can safely assume that their - // path prefix matches workdirPrefix. Testing that here is - // rather expensive so we don't bother. - // final int pfxLen = workdirPrefix.length(); final String p = rsrc.getLocation().toString(); final int pLen = p.length(); -- 2.11.4.GIT