Commit 3498744
committed
refdb: avoid unlimited spinning in case of symref cycles
To determine whether another reflog entry needs to be written for HEAD
on a reference update, we need to see whether HEAD directly or
indirectly points to the reference we're updating. The resolve logic is
currently completely unbounded except an error occurs, which effectively
means that we'd be spinning forever in case we have a symref loop in the
repository refdb.
Let's fix the issue by using `git_refdb_resolve` instead, which is
always bounded.1 parent b895547 commit 3498744
1 file changed
+6
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
329 | | - | |
| 329 | + | |
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| |||
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
| 347 | + | |
357 | 348 | | |
358 | 349 | | |
359 | 350 | | |
360 | 351 | | |
| 352 | + | |
| 353 | + | |
361 | 354 | | |
362 | | - | |
| 355 | + | |
363 | 356 | | |
364 | 357 | | |
365 | 358 | | |
| |||
368 | 361 | | |
369 | 362 | | |
370 | 363 | | |
371 | | - | |
| 364 | + | |
372 | 365 | | |
373 | 366 | | |
374 | 367 | | |
| |||
0 commit comments