Communicate to the user that we're waiting before retrying git push
When the user has just created a fork, it might not yet be ready for writing. This ensures that the wait period between retries is communicated to the user on stderr.
This commit is contained in:
parent
53532d6f28
commit
c10f2ff945
1 changed files with 3 additions and 1 deletions
|
|
@ -99,7 +99,9 @@ func prCreate(cmd *cobra.Command, _ []string) error {
|
|||
if didForkRepo && pushTries < maxPushTries {
|
||||
pushTries++
|
||||
// first wait 2 seconds after forking, then 4s, then 6s
|
||||
time.Sleep(time.Duration(2*pushTries) * time.Second)
|
||||
waitSeconds := 2 * pushTries
|
||||
fmt.Fprintf(cmd.ErrOrStderr(), "waiting %s before retrying...\n", utils.Pluralize(waitSeconds, "second"))
|
||||
time.Sleep(time.Duration(waitSeconds) * time.Second)
|
||||
continue
|
||||
}
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue