forked from gitextensions/gitextensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClone.cs
41 lines (36 loc) · 1.26 KB
/
Clone.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Text;
namespace GitCommands
{
public class CloneDto
{
public string Source { get; set; }
public string Destination { get; set; }
public string Result { get; set; }
public bool Bare { get; set; }
public CloneDto(string source, string destination, bool bare)
{
this.Bare = bare;
this.Source = source;
this.Destination = destination;
}
}
public class Clone
{
public CloneDto Dto { get; set; }
public Clone(CloneDto dto)
{
this.Dto = dto;
}
public void Execute()
{
if (Dto.Bare)
GitCommandHelpers.RunRealCmd("cmd.exe", " /k \"\"" + Settings.GitCommand + "\" clone --bare --shared=all \"" + Dto.Source.Trim() + "\" \"" + Dto.Destination.Trim() + "\"\"");
else
GitCommandHelpers.RunRealCmd("cmd.exe", " /k \"\"" + Settings.GitCommand + "\" clone \"" + Dto.Source.Trim() + "\" \"" + Dto.Destination.Trim() + "\"\"");
//GitCommands.RunRealCmd(Settings.GitCommand, "clone \"" + Dto.Source.Trim() + "\" \"" + Dto.Destination.Trim() + "\"");
Dto.Result = "Done";
}
}
}