mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-15 04:52:20 +00:00
Merge pull request #4168 from Egor18/fixCounter
Fix counter which is not updated in the loop
This commit is contained in:
1 file changed
+2
-4
@@ -553,8 +553,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
|
||||
* @return null if no such build exists.
|
||||
*/
|
||||
public final R getSomeBuildWithWorkspace() {
|
||||
int cnt=0;
|
||||
for (R b = getLastBuild(); cnt<5 && b!=null; b=b.getPreviousBuild()) {
|
||||
for (R b = getLastBuild(); b != null; b = b.getPreviousBuild()) {
|
||||
FilePath ws = b.getWorkspace();
|
||||
if (ws!=null) return b;
|
||||
}
|
||||
@@ -562,8 +561,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
|
||||
}
|
||||
|
||||
private R getSomeBuildWithExistingWorkspace() throws IOException, InterruptedException {
|
||||
int cnt=0;
|
||||
for (R b = getLastBuild(); cnt<5 && b!=null; b=b.getPreviousBuild()) {
|
||||
for (R b = getLastBuild(); b != null; b = b.getPreviousBuild()) {
|
||||
FilePath ws = b.getWorkspace();
|
||||
if (ws!=null && ws.exists()) return b;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user