Commit 05a1834
refs/files: remove redundant check in split_symref_update()
In `split_symref_update()`, there were two checks for duplicate
refnames:
- At the start, `string_list_has_string()` ensures the refname is not
already in `affected_refnames`, preventing duplicates from being
added.
- After adding the refname, another check verifies whether the newly
inserted item has a `util` value.
The second check is unnecessary because the first one guarantees that
`string_list_insert()` will never encounter a preexisting entry.
The `item->util` field is assigned to validate that a rename doesn't
already exist in the list. The validation is done after the first check.
As this check is removed, clean up the validation and the assignment of
this field in `split_head_update()` and `files_transaction_prepare()`.
Signed-off-by: Karthik Nayak <[email protected]>
Acked-by: Patrick Steinhardt <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 7c42ab2 commit 05a1834
1 file changed
+3
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2382 | 2382 | | |
2383 | 2383 | | |
2384 | 2384 | | |
2385 | | - | |
2386 | 2385 | | |
2387 | 2386 | | |
2388 | 2387 | | |
| |||
2421 | 2420 | | |
2422 | 2421 | | |
2423 | 2422 | | |
2424 | | - | |
2425 | | - | |
| 2423 | + | |
2426 | 2424 | | |
2427 | 2425 | | |
2428 | 2426 | | |
| |||
2441 | 2439 | | |
2442 | 2440 | | |
2443 | 2441 | | |
2444 | | - | |
2445 | 2442 | | |
2446 | 2443 | | |
2447 | 2444 | | |
| |||
2496 | 2493 | | |
2497 | 2494 | | |
2498 | 2495 | | |
2499 | | - | |
2500 | | - | |
2501 | | - | |
2502 | | - | |
2503 | | - | |
| 2496 | + | |
2504 | 2497 | | |
2505 | 2498 | | |
2506 | 2499 | | |
| |||
2834 | 2827 | | |
2835 | 2828 | | |
2836 | 2829 | | |
2837 | | - | |
2838 | 2830 | | |
2839 | 2831 | | |
2840 | 2832 | | |
| |||
2843 | 2835 | | |
2844 | 2836 | | |
2845 | 2837 | | |
2846 | | - | |
2847 | | - | |
2848 | | - | |
2849 | | - | |
2850 | | - | |
2851 | | - | |
2852 | | - | |
| 2838 | + | |
2853 | 2839 | | |
2854 | 2840 | | |
2855 | 2841 | | |
| |||
0 commit comments