diff options
| author | Karthik Nayak <karthik.188@gmail.com> | 2026-02-25 10:40:41 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-25 09:27:11 -0800 |
| commit | 2c69ff481938a10660c2078cf83235db26773254 (patch) | |
| tree | 3d168d1367099369e5ee3f1417a698d9c352332d /contrib/persistent-https | |
| parent | 67ad42147a7acc2af6074753ebd03d904476118f (diff) | |
| download | git-2c69ff481938a10660c2078cf83235db26773254.tar.gz git-2c69ff481938a10660c2078cf83235db26773254.zip | |
setup: don't modify repo in `create_reference_database()`
The `create_reference_database()` function is used to create the
reference database during initialization of a repository. The function
calls `repo_set_ref_storage_format()` to set the repositories reference
format. This is an unexpected side-effect of the function. More so
because the function is only called in two locations:
1. During git-init(1) where the value is propagated from the `struct
repository_format repo_fmt` value.
2. During git-clone(1) where the value is propagated from the
`the_repository` value.
The former is valid, however the flow already calls
`repo_set_ref_storage_format()`, so this effort is simply duplicated.
The latter sets the existing value in `the_repository` back to itself.
While this is okay for now, introduction of more fields in
`repo_set_ref_storage_format()` would cause issues, especially
dynamically allocated strings, where we would free/allocate the same
string back into `the_repostiory`.
To avoid all this confusion, clean up the function to no longer take in
and set the repo's reference storage format.
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions
