@@ 50-57 (lines=8) @@ | ||
47 | * |
|
48 | * @return $this |
|
49 | */ |
|
50 | public function cloneRepo($repo, $to = "", $branch = "") |
|
51 | { |
|
52 | $cmd = ['clone', $repo, $to]; |
|
53 | if (!empty($branch)) { |
|
54 | $cmd[] = "--branch $branch"; |
|
55 | } |
|
56 | return $this->exec($cmd); |
|
57 | } |
|
58 | ||
59 | /** |
|
60 | * Executes `git clone` with depth 1 as default |
|
@@ 69-77 (lines=9) @@ | ||
66 | * |
|
67 | * @return $this |
|
68 | */ |
|
69 | public function cloneShallow($repo, $to = '', $branch = "", $depth = 1) |
|
70 | { |
|
71 | $cmd = ["clone --depth $depth", $repo, $to]; |
|
72 | if (!empty($branch)) { |
|
73 | $cmd[] = "--branch $branch"; |
|
74 | } |
|
75 | ||
76 | return $this->exec($cmd); |
|
77 | } |
|
78 | ||
79 | /** |
|
80 | * Executes `git add` command with files to add pattern |