dockerfile-image-update/src/main/java/com/salesforce/dockerfileimageupdate/utils/GitHubUtil.java
/**
     * Attempt to find the provided {@code branch}. Generally, github-api will retry for us without
     * the need to do this. This particular process is useful when we need more time such as when
     * we are waiting for a repository to be forked.
     *
     * @param repo - wait until we can retrieve {@code branch from this repo}
     * @param branchName - the branch to wait for
     */
Attempt to find the provided  branch. Generally, github-api will retry for us without
the need to do this. This particular process is useful when we need more time such as when
we are waiting for a repository to be forked.

@param repo - wait until we can retrieve  branch from this repo
@param branchName - the branch to wait for
Attempt to find the provided branch . Generally github - api will retry for us without the need to do this . This particular process is useful when we need more time such as when we are waiting for a repository to be forked . @param repo - wait until we can retrieve branch from this repo @param branchName - the branch to wait for
protected GHBranch tryRetrievingBranch(GHRepository repo, String branchName) throws InterruptedException {
        for (int i = 0; i < 10; i++) {
            try {
                GHBranch branch = repo.getBranch(branchName);
                if (branch != null) {
                    return branch;
                }
                log.warn(String.format(NO_BRANCH_WARN_FORMAT, branchName, repo.getName()));
            } catch (IOException exception) {
                log.warn(String.format(NO_BRANCH_WARN_FORMAT + " Exception was: %s",
                                branchName, repo.getName(), exception.getMessage()));
            }
            waitFor(TimeUnit.SECONDS.toMillis(1));
        }
        return null;
    }
protected GHBranch tryRetrievingBranch ( GHRepository repo , String branchName ) throws InterruptedException { for ( int i = 0 ; i < 10 ; i ++ ) { try { GHBranch branch = repo . getBranch ( branchName ) ; if ( branch != null ) { return branch ; } log . warn ( String . format ( NO_BRANCH_WARN_FORMAT , branchName , repo . getName ( ) ) ) ; } catch ( IOException exception ) { log . warn ( String . format ( NO_BRANCH_WARN_FORMAT + " Exception was: %s" , branchName , repo . getName ( ) , exception . getMessage ( ) ) ) ; } waitFor ( TimeUnit . SECONDS . toMillis ( 1 ) ) ; } return null ; }
Attempt to find the provided {@code branch}.
Attempt to find the provided { @code branch } .
// Keep waiting - this is expected rather than a null branch but we'll handle // both scenarios as neither would indicate that the repo branch is ready