-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/mr_checkout: check existing remotes before creating one
In case tacking is enabled `lab mr checkout -t`, a new remote is created with the name of the MR author's name without checking if the already available remotes matches the one from which the MR was checked-out. A particular case where it happens constantly is in the branching development model: developers use a single repo to push their work as branches. This patch change the code behavor by first checking if any of the existent remotes has the same path as the source MR project before creating a new remote. If no remote is found, then create a new one with the MR author's name. Signed-off-by: Bruno Meneguele <[email protected]>
- Loading branch information
Showing
2 changed files
with
28 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,7 +87,7 @@ func Test_mrCheckoutCmd_track(t *testing.T) { | |
t.Fatal(err) | ||
} | ||
remotes := string(gitOut) | ||
require.Contains(t, remotes, "zaquestion [email protected]:zaquestion/test.git") | ||
require.Contains(t, remotes, "origin [email protected]:zaquestion/test.git") | ||
} | ||
|
||
func Test_mrCheckoutCmdRunWithDifferentName(t *testing.T) { | ||
|