@@ -1968,7 +1968,6 @@ void create_reference_database(unsigned int ref_storage_format,
1968
1968
static int create_default_files (const char * template_path ,
1969
1969
const char * original_git_dir ,
1970
1970
const struct repository_format * fmt ,
1971
- int prev_bare_repository ,
1972
1971
int init_shared_repository )
1973
1972
{
1974
1973
struct stat st1 ;
@@ -2003,34 +2002,8 @@ static int create_default_files(const char *template_path,
2003
2002
*/
2004
2003
if (init_shared_repository != -1 )
2005
2004
set_shared_repository (init_shared_repository );
2006
- /*
2007
- * TODO: heed core.bare from config file in templates if no
2008
- * command-line override given
2009
- */
2010
- is_bare_repository_cfg = prev_bare_repository || !work_tree ;
2011
- /* TODO (continued):
2012
- *
2013
- * Unfortunately, the line above is equivalent to
2014
- * is_bare_repository_cfg = !work_tree;
2015
- * which ignores the config entirely even if no `--[no-]bare`
2016
- * command line option was present.
2017
- *
2018
- * To see why, note that before this function, there was this call:
2019
- * prev_bare_repository = is_bare_repository()
2020
- * expanding the right hand side:
2021
- * = is_bare_repository_cfg && !get_git_work_tree()
2022
- * = is_bare_repository_cfg && !work_tree
2023
- * note that the last simplification above is valid because nothing
2024
- * calls repo_init() or set_git_work_tree() between any of the
2025
- * relevant calls in the code, and thus the !get_git_work_tree()
2026
- * calls will return the same result each time. So, what we are
2027
- * interested in computing is the right hand side of the line of
2028
- * code just above this comment:
2029
- * prev_bare_repository || !work_tree
2030
- * = is_bare_repository_cfg && !work_tree || !work_tree
2031
- * = !work_tree
2032
- * because "A && !B || !B == !B" for all boolean values of A & B.
2033
- */
2005
+
2006
+ is_bare_repository_cfg = !work_tree ;
2034
2007
2035
2008
/*
2036
2009
* We would have created the above under user's umask -- under
@@ -2182,7 +2155,6 @@ int init_db(const char *git_dir, const char *real_git_dir,
2182
2155
int exist_ok = flags & INIT_DB_EXIST_OK ;
2183
2156
char * original_git_dir = real_pathdup (git_dir , 1 );
2184
2157
struct repository_format repo_fmt = REPOSITORY_FORMAT_INIT ;
2185
- int prev_bare_repository ;
2186
2158
2187
2159
if (real_git_dir ) {
2188
2160
struct stat st ;
@@ -2208,7 +2180,6 @@ int init_db(const char *git_dir, const char *real_git_dir,
2208
2180
2209
2181
safe_create_dir (git_dir , 0 );
2210
2182
2211
- prev_bare_repository = is_bare_repository ();
2212
2183
2213
2184
/* Check to see if the repository version is right.
2214
2185
* Note that a newly created repository does not have
@@ -2221,8 +2192,7 @@ int init_db(const char *git_dir, const char *real_git_dir,
2221
2192
validate_ref_storage_format (& repo_fmt , ref_storage_format );
2222
2193
2223
2194
reinit = create_default_files (template_dir , original_git_dir ,
2224
- & repo_fmt , prev_bare_repository ,
2225
- init_shared_repository );
2195
+ & repo_fmt , init_shared_repository );
2226
2196
2227
2197
/*
2228
2198
* Now that we have set up both the hash algorithm and the ref storage
0 commit comments