Commit 58004d9
committed
revision: introduce rev_walk_mode to clarify get_revision_1()
get_revision_1() dispatches to different walk strategies based on a
combination of rev_info flags: reflog_info, topo_walk_info, limited,
and no_walk. These conditions are checked in multiple places within
the function — once to select the next commit, and again to decide
how to expand parents — and the two chains must stay in sync.
Extract the mode selection into a rev_walk_mode enum and a small
get_walk_mode() helper, resolved once at the top of get_revision_1().
Both dispatch sites now switch on the same mode variable, making it
obvious that they agree and easier to verify that all modes are
handled.
No functional change.
Signed-off-by: Kristofer Karlsson <krka@spotify.com>1 parent 3cf7992 commit 58004d9
1 file changed
Lines changed: 54 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4322 | 4322 | | |
4323 | 4323 | | |
4324 | 4324 | | |
| 4325 | + | |
| 4326 | + | |
| 4327 | + | |
| 4328 | + | |
| 4329 | + | |
| 4330 | + | |
| 4331 | + | |
| 4332 | + | |
| 4333 | + | |
| 4334 | + | |
| 4335 | + | |
| 4336 | + | |
| 4337 | + | |
| 4338 | + | |
| 4339 | + | |
| 4340 | + | |
| 4341 | + | |
| 4342 | + | |
| 4343 | + | |
| 4344 | + | |
| 4345 | + | |
4325 | 4346 | | |
4326 | 4347 | | |
| 4348 | + | |
| 4349 | + | |
| 4350 | + | |
| 4351 | + | |
| 4352 | + | |
4327 | 4353 | | |
4328 | 4354 | | |
4329 | 4355 | | |
4330 | | - | |
| 4356 | + | |
| 4357 | + | |
4331 | 4358 | | |
4332 | | - | |
| 4359 | + | |
| 4360 | + | |
4333 | 4361 | | |
4334 | | - | |
| 4362 | + | |
| 4363 | + | |
| 4364 | + | |
4335 | 4365 | | |
4336 | | - | |
4337 | | - | |
4338 | | - | |
| 4366 | + | |
| 4367 | + | |
4339 | 4368 | | |
| 4369 | + | |
4340 | 4370 | | |
4341 | 4371 | | |
4342 | 4372 | | |
4343 | 4373 | | |
4344 | 4374 | | |
4345 | | - | |
| 4375 | + | |
4346 | 4376 | | |
4347 | 4377 | | |
4348 | 4378 | | |
4349 | 4379 | | |
4350 | 4380 | | |
4351 | 4381 | | |
4352 | 4382 | | |
4353 | | - | |
| 4383 | + | |
4354 | 4384 | | |
4355 | 4385 | | |
4356 | 4386 | | |
4357 | 4387 | | |
4358 | | - | |
| 4388 | + | |
| 4389 | + | |
4359 | 4390 | | |
4360 | | - | |
| 4391 | + | |
| 4392 | + | |
4361 | 4393 | | |
4362 | | - | |
4363 | | - | |
4364 | | - | |
4365 | | - | |
4366 | | - | |
4367 | | - | |
| 4394 | + | |
| 4395 | + | |
| 4396 | + | |
| 4397 | + | |
| 4398 | + | |
| 4399 | + | |
| 4400 | + | |
| 4401 | + | |
| 4402 | + | |
| 4403 | + | |
| 4404 | + | |
| 4405 | + | |
4368 | 4406 | | |
4369 | 4407 | | |
4370 | 4408 | | |
| |||
0 commit comments