jesseduffield / lazygit

simple terminal UI for git commands
MIT License
51.38k stars 1.8k forks source link

Fix pushing to branch when upstream not stored locally #3619

Closed stefanhaller closed 4 months ago

stefanhaller commented 4 months ago

This fixes three different problems; two were recent regressions, one has never worked.

  1. For branches whose remote is not stored locally, don't ask to force push right away. Try a normal push first. This broke with #3528.
  2. For branches whose remote is not stored locally (but only for those), if the server rejects the update, ask to force push. This broke with #3387.
  3. When force-pushing a branch whose remote is not stored locally, use --force instead of --force-with-lease; otherwise the push would always fail with a "stale info" error. This has never worked.

Fixes #3588.

codacy-production[bot] commented 4 months ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for ab797fe986e1fd3acedefde4ef286cddc5046b49[^1] :white_check_mark: 99.72%
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (ab797fe986e1fd3acedefde4ef286cddc5046b49) | Report Missing | Report Missing | Report Missing | | | Head commit (3284d69886250576b0b1799a0e691fd7bfaba655) | 51344 | 43297 | 84.33% | **Coverage variation** is the difference between the coverage for the head and common ancestor commits of the pull request branch: ` - `
Diff coverage details | | Coverable lines | Covered lines | Diff coverage | | ------------- | ------------- | ------------- | ------------- | | Pull request (#3619) | 1446 | 1442 | **99.72%** | **Diff coverage** is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: `/ * 100%`

See your quality gate settings    Change summary preferences

Codacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more [^1]: Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.