Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Don't include git reference in remote.PushContext #1304

Open
carsonoid opened this issue Apr 1, 2020 · 0 comments
Open

Don't include git reference in remote.PushContext #1304

carsonoid opened this issue Apr 1, 2020 · 0 comments

Comments

@carsonoid
Copy link

Right now, non fast-forward errors during remote pushes create a new error which includes the git reference :

return fmt.Errorf("non-fast-forward update: %s", cmd.Name.String())
worktree.go has a dedicated ErrNonFastForwardUpdate error which should be used instead.

The main issue is that these two bits of code work differently:

err := w.PullContext(ctx, options) // might return a git.ErrNonFastForwardUpdate
if err != nil && err == git.ErrNonFastForwardUpdate { 
  // this code might get  executed
}


err := r.PushContext(ctx, options) // might return result of fmt.Errorf("non-fast-forward update: %s", cmd.Name.String())
if err != nil && err == git.ErrNonFastForwardUpdate { 
  // this code can never get executed
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant