Code Duplication    Length = 8-9 lines in 2 locations

src/Task/Vcs/GitStack.php 2 locations

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