Skip to content

Commit dfa566c

Browse files
authored
Revert "Clone repositories with a depth of 1 (#104)" (#116)
This reverts commit c45db62. Co-authored-by: Danny Ranson <[email protected]>
1 parent 119f8ff commit dfa566c

File tree

3 files changed

+7
-18
lines changed

3 files changed

+7
-18
lines changed

README.md

+1-12
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,7 @@ turbolift foreach --repos repoFile2.txt sed 's/pattern2/replacement2/g'
123123
This creates a fork and clones all repositories listed in the `repos.txt` file into the `work` directory.
124124
You may wish to skip the fork and work on the upstream repository branch directly with the flag `--no-fork`.
125125

126-
> NTLD: if one of the repositories in the list requires a fork to create a PR,
127-
> omit the `--no-fork` flag and let all the repositories be forked.
128-
> For now, it's an all-or-nothing scenario.
129-
130-
> [!NOTE]
131-
> Repositories are cloned with the git flag `--depth=1`.
132-
> If you need the full commit history and tags, you can run the following command
133-
> after running `turbolift clone`:
134-
>
135-
> ```shell
136-
> turbolift foreach git fetch --unshallow --tags
137-
> ```
126+
> NTLD: if one of the repositories in the list requires a fork to create a PR, omit the `--no-fork` flag and let all the repositories be forked. For now it's a all-or-nothing scenario.
138127
139128
### Making changes
140129

internal/github/github.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ func (r *RealGitHub) CreatePullRequest(output io.Writer, workingDir string, pr P
7272
}
7373

7474
func (r *RealGitHub) ForkAndClone(output io.Writer, workingDir string, fullRepoName string) error {
75-
return execInstance.Execute(output, workingDir, "gh", "repo", "fork", "--clone=true", fullRepoName, "--", "--depth=1")
75+
return execInstance.Execute(output, workingDir, "gh", "repo", "fork", "--clone=true", fullRepoName)
7676
}
7777

7878
func (r *RealGitHub) Clone(output io.Writer, workingDir string, fullRepoName string) error {
79-
return execInstance.Execute(output, workingDir, "gh", "repo", "clone", fullRepoName, "--", "--depth=1")
79+
return execInstance.Execute(output, workingDir, "gh", "repo", "clone", fullRepoName)
8080
}
8181

8282
func (r *RealGitHub) ClosePullRequest(output io.Writer, workingDir string, branchName string) error {

internal/github/github_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func TestItReturnsErrorOnFailedFork(t *testing.T) {
3131
assert.Error(t, err)
3232

3333
fakeExecutor.AssertCalledWith(t, [][]string{
34-
{"work/org", "gh", "repo", "fork", "--clone=true", "org/repo1", "--", "--depth=1"},
34+
{"work/org", "gh", "repo", "fork", "--clone=true", "org/repo1"},
3535
})
3636
}
3737

@@ -43,7 +43,7 @@ func TestItReturnsNilErrorOnSuccessfulFork(t *testing.T) {
4343
assert.NoError(t, err)
4444

4545
fakeExecutor.AssertCalledWith(t, [][]string{
46-
{"work/org", "gh", "repo", "fork", "--clone=true", "org/repo1", "--", "--depth=1"},
46+
{"work/org", "gh", "repo", "fork", "--clone=true", "org/repo1"},
4747
})
4848
}
4949

@@ -55,7 +55,7 @@ func TestItReturnsErrorOnFailedClone(t *testing.T) {
5555
assert.Error(t, err)
5656

5757
fakeExecutor.AssertCalledWith(t, [][]string{
58-
{"work/org", "gh", "repo", "clone", "org/repo1", "--", "--depth=1"},
58+
{"work/org", "gh", "repo", "clone", "org/repo1"},
5959
})
6060
}
6161

@@ -67,7 +67,7 @@ func TestItReturnsNilErrorOnSuccessfulClone(t *testing.T) {
6767
assert.NoError(t, err)
6868

6969
fakeExecutor.AssertCalledWith(t, [][]string{
70-
{"work/org", "gh", "repo", "clone", "org/repo1", "--", "--depth=1"},
70+
{"work/org", "gh", "repo", "clone", "org/repo1"},
7171
})
7272
}
7373

0 commit comments

Comments
 (0)