package com.atlassian.bitbucket.mesh.git.builder;

import com.atlassian.bitbucket.mesh.config.GitProcessConfig;

import javax.annotation.Nonnull;

public class ConfigurableGitProcessBuilderConfigurer implements GitProcessBuilderConfigurer {

    private final GitProcessConfig processConfig;

    public ConfigurableGitProcessBuilderConfigurer(GitProcessConfig processConfig) {
        this.processConfig = processConfig;
    }

    @Override
    public void configure(@Nonnull GitProcessBuilder builder) {
        processConfig.getConfiguration().forEach(builder::withConfiguration);
        processConfig.getEnvironment().forEach(builder::withEnvironment);
    }
}
