<commit_before>import java.io.File;

class Git {
    static boolean branchPresent( File dir, String branch ) {
        return ! ExecuteProcess.executeCmd0(dir, "git ls-remote . $branch").empty;
    }

    static String getRemoteBranch(RepoEnv env, String branch) {
        def remoteName = env.manifest.remote[0].@name
        return "$remoteName/$branch"
    } 
    
    static void mergeFeatureBranch( RepoEnv env, String branch ) {
        def remoteBranch = getRemoteBranch(env, branch)

        RepoManifest.forEach(env,
                { Node project -> branchPresent(new File(env.basedir,project.@path), remoteBranch)  && !"build".equals(project.@path) }, 
                { Node project ->
                    println "branch $remoteBranch found in ${project.@path}"
                    println ExecuteProcess.executeCmd0(new File(env.basedir, project.@path),"git merge $remoteBranch")
                })
    }

    static void createFeatureBundles( RepoEnv env, String branch ) {
        def remoteBranch = getRemoteBranch(env, branch)

        RepoManifest.forEach(env,
                { Node project -> branchPresent(new File(env.basedir,project.@path), remoteBranch)  && !"build".equals(project.@path)}, 
                { Node project ->
                    println "branch $remoteBranch found in ${project.@path}"
                    def gitName = new File(project.@name).getName().split("\\.").first()
                    println gitName
                    def bundleFile = new File(env.getBuildTarget(),"${gitName}.bundle")
                    println ExecuteProcess.executeCmd0(new File(env.basedir, project.@path),
                        "git bundle create $bundleFile $remoteBranch")
                })
    }
}
<commit_msg>SIR-99 use prepareBuild branch Luke<commit_after>import java.io.File;

class Git {

    static final String BUILD = "build"
    static final String PREPARE_BUILD = "prepareBuild"
            
    static boolean branchPresent( File dir, String branch ) {
        return ! ExecuteProcess.executeCmd0(dir, "git ls-remote . $branch").empty;
    }

    static String getRemoteBranch(RepoEnv env, String branch) {
        def remoteName = env.manifest.remote[0].@name
        return "$remoteName/$branch"
    }

    static void deleteBranch(File dir, String branch) {
        ExecuteProcess.executeCmd0(dir,"git branch -d $branch")
    }
    
    static void mergeFeatureBranch( RepoEnv env, String branch ) {
        def remoteBranch = getRemoteBranch(env, branch)

        RepoManifest.forEach(env, 
            { Node project ->
                branchPresent(new File(env.basedir,project.@path), remoteBranch) && !BUILD.equals(project.@path)
            }, 
            { Node project ->
                def dir = new File(env.basedir, project.@path)
                println "branch $remoteBranch found in ${project.@path}"
                if(branchPresent(dir, PREPARE_BUILD)){
                    deleteBranch(dir, PREPARE_BUILD)
                }
                println ExecuteProcess.executeCmd0(dir,"git checkout -b $PREPARE_BUILD")
                println ExecuteProcess.executeCmd0(dir,"git merge $remoteBranch")
            })
    }

    static void createFeatureBundles( RepoEnv env, String branch ) {
        def remoteBranch = getRemoteBranch(env, branch)

        RepoManifest.forEach(env, 
            { Node project ->
                branchPresent(new File(env.basedir,project.@path), remoteBranch) && !BUILD.equals(project.@path)
            }, 
            { Node project ->
                println "branch $remoteBranch found in ${project.@path}"
                def gitName = new File(project.@name).getName().split("\\.").first()
                println gitName
                def bundleFile = new File(env.getBuildTarget(),"${gitName}.bundle")
                println ExecuteProcess.executeCmd0(new File(env.basedir, project.@path),
                    "git bundle create $bundleFile $remoteBranch")
            })
    }
}

{'fraction_non_alphanumeric': 0.10860295961876097, 'fraction_numerical': 0.0030097817908201654, 'mean_word_length': 2.1827613727055066, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '211290', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1057, 'n_words': 244}