package org.jenkinsci.plugins.gitclient;

import hudson.Extension;
import hudson.plugins.git.GitTool;
import hudson.tools.ToolProperty;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;

import java.util.Collections;
import java.util.List;

/**
 * JGit, configured with the Apache HTTP Client, as {@link hudson.plugins.git.GitTool}
 */
public class JGitApacheTool extends GitTool {
    private static final long serialVersionUID = 1L;

    @DataBoundConstructor
    public JGitApacheTool(final List<? extends ToolProperty<?>> properties) {
        super(MAGIC_EXENAME, MAGIC_EXENAME, properties);
    }

    public JGitApacheTool() {
        this(Collections.<ToolProperty<?>>emptyList());
    }

    /** {@inheritDoc} */
    @Override
    public GitTool.DescriptorImpl getDescriptor() {
        return super.getDescriptor();
    }

    @Extension @Symbol(MAGIC_EXENAME)
    public static class DescriptorImpl extends GitTool.DescriptorImpl {
        @Override
        public String getDisplayName() {
            return "JGit with Apache HTTP client";
        }
    }

    /**
     * {@link Git} recognizes this as a magic executable name to use {@link JGitAPIImpl}.
     */
    public static final String MAGIC_EXENAME = "jgitapache";

}

@@ -33,19 +33,17 @@
 tclient;
-%0D%0A%0D
+%0A
 %0Aimport 
@@ -59,17 +59,16 @@
 tension;
-%0D
 %0Aimport 
@@ -94,17 +94,16 @@
 GitTool;
-%0D
 %0Aimport 
@@ -128,17 +128,16 @@
 roperty;
-%0D
 %0Aimport 
@@ -157,17 +157,16 @@
 .Symbol;
-%0D
 %0Aimport 
@@ -206,19 +206,17 @@
 tructor;
-%0D%0A%0D
+%0A
 %0Aimport 
@@ -237,17 +237,16 @@
 ections;
-%0D
 %0Aimport 
@@ -264,16 +264,13 @@
 ist;
-%0D%0A%0D
+%0A
 %0A/**
-%0D
 %0A * 
@@ -356,14 +356,12 @@
 ool%7D
-%0D
 %0A */
-%0D
 %0Apub
@@ -402,17 +402,16 @@
 itTool %7B
-%0D
 %0A    pri
@@ -455,19 +455,17 @@
 ID = 1L;
-%0D%0A%0D
+%0A
 %0A    @Da
@@ -482,17 +482,16 @@
 structor
-%0D
 %0A    pub
@@ -560,17 +560,16 @@
 rties) %7B
-%0D
 %0A       
@@ -617,26 +617,23 @@
 erties);
-%0D
 %0A    %7D
-%0D%0A%0D
+%0A
 %0A    pub
@@ -650,25 +650,24 @@
 acheTool() %7B
-%0D
 %0A        thi
@@ -710,26 +710,23 @@
 List());
-%0D
 %0A    %7D
-%0D%0A%0D
+%0A
 %0A    /**
@@ -742,17 +742,16 @@
 tDoc%7D */
-%0D
 %0A    @Ov
@@ -752,25 +752,24 @@
    @Override
-%0D
 %0A    public 
@@ -804,25 +804,24 @@
 scriptor() %7B
-%0D
 %0A        ret
@@ -846,26 +846,23 @@
 iptor();
-%0D
 %0A    %7D
-%0D%0A%0D
+%0A
 %0A    @Ex
@@ -891,17 +891,16 @@
 EXENAME)
-%0D
 %0A    pub
@@ -963,17 +963,16 @@
 orImpl %7B
-%0D
 %0A       
@@ -981,17 +981,16 @@
 Override
-%0D
 %0A       
@@ -1022,17 +1022,16 @@
 Name() %7B
-%0D
 %0A       
@@ -1073,17 +1073,16 @@
 client%22;
-%0D
 %0A       
@@ -1087,26 +1087,23 @@
    %7D
-%0D
 %0A    %7D
-%0D%0A%0D
+%0A
 %0A    /**
 %0D%0A  
@@ -1098,17 +1098,16 @@
 %0A    /**
-%0D
 %0A     * 
@@ -1192,17 +1192,16 @@
 pl%7D.
-%0D
 %0A     */
 %0D%0A  
@@ -1196,17 +1196,16 @@
 %0A     */
-%0D
 %0A    pub
@@ -1261,11 +1261,8 @@
 he%22;
-%0D%0A%0D
+%0A
 %0A%7D
-%0D
 %0A

Fix line endings in JGitApacheTool.java