Issue 60723 resolved
- [x] closes #60723 
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `core/reshape/concat.py` file if fixing a bug or adding a new feature.
I am attaching test case:
![image](https://github.com/user-attachments/assets/a67a7794-4062-40f6-8cab-93a73db3909d)
![image](https://github.com/user-attachments/assets/dabe284d-2a90-44cf-8d7d-ec85d465e093)

Adjusted the condition to set name = 0 only when name is explicitly None.
Previously, the name attribute was being overwritten unconditionally when ignore_index=True, even if a valid name existed.


Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.