Skip to content

Commit 8400ed4

Browse files
committed
optimize api calls
1 parent ddd0b7c commit 8400ed4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pkg/cmd/repo/rename/rename.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,11 @@ func renameRun(opts *RenameOptions) error {
123123
oldRepoURL := opts.oldRepoSelector
124124
newRepoName := opts.newRepoSelector
125125

126-
currentUser, err := api.CurrentLoginName(apiClient, ghinstance.Default())
127-
if err != nil {
128-
return err
129-
}
130-
131126
if !strings.Contains(oldRepoURL, "/") {
127+
currentUser, err := api.CurrentLoginName(apiClient, ghinstance.Default())
128+
if err != nil {
129+
return err
130+
}
132131
oldRepoURL = currentUser + "/" + oldRepoURL
133132
}
134133

0 commit comments

Comments
 (0)