package org.paylogic.jenkins.advancedscm.backends.helpers;

import hudson.EnvVars;
import hudson.Launcher;
import hudson.model.TaskListener;
import hudson.model.Node;
import hudson.plugins.git.GitSCM;
import org.jenkinsci.plugins.gitclient.CliGitAPIImpl;

import java.io.File;

/**
 * Created by bubenkoff on 4/22/14.
 */
public class AdvancedCliGit extends CliGitAPIImpl{

    protected transient Launcher launcher;

    public AdvancedCliGit(GitSCM scm, Launcher launcher, Node node, File workspace,
                            TaskListener listener, EnvVars environment) {
        super(scm.getGitExe(node, environment, listener), workspace, listener, environment);
        this.launcher = launcher;
    }
}

@@ -120,28 +120,20 @@
 n.model.
-TaskListener
+Node
 ;%0Aimport
@@ -138,36 +138,44 @@
 rt hudson.model.
-Node
+TaskListener
 ;%0Aimport hudson.
@@ -269,16 +269,48 @@
 io.File;
+%0Aimport java.lang.reflect.Field;
 %0A%0A/**%0A *
@@ -403,52 +403,8 @@
 l%7B%0A%0A
-    protected transient Launcher launcher;%0A%0A
     
@@ -663,32 +663,301 @@
    t
-his.launcher = launcher;
+ry %7B%0A            Field field = CliGitAPIImpl.class.getDeclaredField(%22launcher%22);%0A            field.setAccessible(true);%0A            field.set(this, launcher);%0A        %7D catch (NoSuchFieldException exception) %7B%0A        %7D%0A        catch (IllegalAccessException exception) %7B%0A            %0A        %7D
 %0A   

set launcher for git tool