Commit 64ac39a
push: allow pushing new branches with --force-with-lease
If there is no upstream information for a branch, it is likely that it
is newly created and can safely be pushed under the normal fast-forward
rules. Relax the --force-with-lease check so that we do not reject
these branches immediately but rather attempt to push them as new
branches, using the null SHA-1 as the expected value.
In fact, it is already possible to push new branches using the explicit
--force-with-lease=<branch>:<expect> syntax, so all we do here is make
this behaviour the default if no explicit "expect" value is specified.
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent eee98e7 commit 64ac39a
3 files changed
Lines changed: 15 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1554 | 1554 | | |
1555 | 1555 | | |
1556 | 1556 | | |
1557 | | - | |
1558 | | - | |
| 1557 | + | |
1559 | 1558 | | |
1560 | 1559 | | |
1561 | 1560 | | |
| |||
2355 | 2354 | | |
2356 | 2355 | | |
2357 | 2356 | | |
2358 | | - | |
| 2357 | + | |
2359 | 2358 | | |
2360 | 2359 | | |
2361 | 2360 | | |
| |||
2365 | 2364 | | |
2366 | 2365 | | |
2367 | 2366 | | |
2368 | | - | |
| 2367 | + | |
2369 | 2368 | | |
2370 | 2369 | | |
2371 | 2370 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
194 | 206 | | |
195 | 207 | | |
196 | 208 | | |
| |||
0 commit comments