From e342d6a2d837aeba20982afe6990ead824278dcd Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 26 Jun 2020 17:18:08 +0900 Subject: [PATCH] LfsConnectionFactory#getLfsUrl: Fix unconditional break in for-loop When iterating over the remote URLs to find one that matches "origin", it always exits after the first iteration whether it has found the remote or not. The break should be inside the conditional block so that it exits when "origin" is found, otherwise continues to iterate over the remaining remote URLs. Found by Sonar Lint. Change-Id: Ic969e54071d1cf095334007c1c1bab6579044dd2 Signed-off-by: David Pursehouse --- .../src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java index cbad1b66a..7a0ed456c 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java @@ -112,8 +112,8 @@ public class LfsConnectionFactory { remoteUrl = config.getString( ConfigConstants.CONFIG_KEY_REMOTE, remote, ConfigConstants.CONFIG_KEY_URL); + break; } - break; } if (lfsUrl == null && remoteUrl != null) { try {