@@ -165,8 +165,8 @@ void git_repository_free(git_repository *repo)
165165 git_buf_free (git_array_get (repo -> reserved_names , i ));
166166 git_array_clear (repo -> reserved_names );
167167
168- git__free (repo -> path_gitlink );
169- git__free (repo -> path_repository );
168+ git__free (repo -> gitlink );
169+ git__free (repo -> gitdir );
170170 git__free (repo -> commondir );
171171 git__free (repo -> workdir );
172172 git__free (repo -> namespace );
@@ -288,15 +288,15 @@ static int load_workdir(git_repository *repo, git_config *config, git_buf *paren
288288
289289 if (ce && ce -> value ) {
290290 if ((error = git_path_prettify_dir (
291- & worktree , ce -> value , repo -> path_repository )) < 0 )
291+ & worktree , ce -> value , repo -> gitdir )) < 0 )
292292 goto cleanup ;
293293
294294 repo -> workdir = git_buf_detach (& worktree );
295295 }
296296 else if (parent_path && git_path_isdir (parent_path -> ptr ))
297297 repo -> workdir = git_buf_detach (parent_path );
298298 else {
299- if (git_path_dirname_r (& worktree , repo -> path_repository ) < 0 ||
299+ if (git_path_dirname_r (& worktree , repo -> gitdir ) < 0 ||
300300 git_path_to_dir (& worktree ) < 0 ) {
301301 error = -1 ;
302302 goto cleanup ;
@@ -553,8 +553,8 @@ int git_repository_open_bare(
553553 repo = repository_alloc ();
554554 GITERR_CHECK_ALLOC (repo );
555555
556- repo -> path_repository = git_buf_detach (& path );
557- GITERR_CHECK_ALLOC (repo -> path_repository );
556+ repo -> gitdir = git_buf_detach (& path );
557+ GITERR_CHECK_ALLOC (repo -> gitdir );
558558 repo -> commondir = git_buf_detach (& common_path );
559559 GITERR_CHECK_ALLOC (repo -> commondir );
560560
@@ -763,19 +763,19 @@ int git_repository_open_ext(
763763 repo = repository_alloc ();
764764 GITERR_CHECK_ALLOC (repo );
765765
766- repo -> path_repository = git_buf_detach (& path );
767- GITERR_CHECK_ALLOC (repo -> path_repository );
766+ repo -> gitdir = git_buf_detach (& path );
767+ GITERR_CHECK_ALLOC (repo -> gitdir );
768768
769769 if (link_path .size ) {
770- repo -> path_gitlink = git_buf_detach (& link_path );
771- GITERR_CHECK_ALLOC (repo -> path_gitlink );
770+ repo -> gitlink = git_buf_detach (& link_path );
771+ GITERR_CHECK_ALLOC (repo -> gitlink );
772772 }
773773 if (common_path .size ) {
774774 repo -> commondir = git_buf_detach (& common_path );
775775 GITERR_CHECK_ALLOC (repo -> commondir );
776776 }
777777
778- if (repo -> path_gitlink && repo -> commondir && strcmp (repo -> path_gitlink , repo -> commondir ))
778+ if (repo -> gitlink && repo -> commondir && strcmp (repo -> gitlink , repo -> commondir ))
779779 repo -> is_worktree = 1 ;
780780
781781 /*
@@ -1114,7 +1114,7 @@ int git_repository_index__weakptr(git_index **out, git_repository *repo)
11141114 git_buf index_path = GIT_BUF_INIT ;
11151115 git_index * index ;
11161116
1117- if ((error = git_buf_joinpath (& index_path , repo -> path_repository , GIT_INDEX_FILE )) < 0 )
1117+ if ((error = git_buf_joinpath (& index_path , repo -> gitdir , GIT_INDEX_FILE )) < 0 )
11181118 return error ;
11191119
11201120 error = git_index_open (& index , index_path .ptr );
@@ -1230,13 +1230,13 @@ bool git_repository__reserved_names(
12301230 prefixcmp = (error || ignorecase ) ? git__prefixcmp_icase :
12311231 git__prefixcmp ;
12321232
1233- if (repo -> path_gitlink &&
1234- reserved_names_add8dot3 (repo , repo -> path_gitlink ) < 0 )
1233+ if (repo -> gitlink &&
1234+ reserved_names_add8dot3 (repo , repo -> gitlink ) < 0 )
12351235 goto on_error ;
12361236
1237- if (repo -> path_repository &&
1238- prefixcmp (repo -> path_repository , repo -> workdir ) == 0 &&
1239- reserved_names_add8dot3 (repo , repo -> path_repository ) < 0 )
1237+ if (repo -> gitdir &&
1238+ prefixcmp (repo -> gitdir , repo -> workdir ) == 0 &&
1239+ reserved_names_add8dot3 (repo , repo -> gitdir ) < 0 )
12401240 goto on_error ;
12411241 }
12421242 }
@@ -2237,7 +2237,7 @@ int git_repository_item_path(git_buf *out, git_repository *repo, git_repository_
22372237const char * git_repository_path (git_repository * repo )
22382238{
22392239 assert (repo );
2240- return repo -> path_repository ;
2240+ return repo -> gitdir ;
22412241}
22422242
22432243const char * git_repository_workdir (git_repository * repo )
@@ -2366,7 +2366,7 @@ int git_repository__set_orig_head(git_repository *repo, const git_oid *orig_head
23662366
23672367 git_oid_fmt (orig_head_str , orig_head );
23682368
2369- if ((error = git_buf_joinpath (& file_path , repo -> path_repository , GIT_ORIG_HEAD_FILE )) == 0 &&
2369+ if ((error = git_buf_joinpath (& file_path , repo -> gitdir , GIT_ORIG_HEAD_FILE )) == 0 &&
23702370 (error = git_filebuf_open (& file , file_path .ptr , GIT_FILEBUF_FORCE , GIT_MERGE_FILE_MODE )) == 0 &&
23712371 (error = git_filebuf_printf (& file , "%.*s\n" , GIT_OID_HEXSZ , orig_head_str )) == 0 )
23722372 error = git_filebuf_commit (& file );
@@ -2387,7 +2387,7 @@ int git_repository_message(git_buf *out, git_repository *repo)
23872387
23882388 git_buf_sanitize (out );
23892389
2390- if (git_buf_joinpath (& path , repo -> path_repository , GIT_MERGE_MSG_FILE ) < 0 )
2390+ if (git_buf_joinpath (& path , repo -> gitdir , GIT_MERGE_MSG_FILE ) < 0 )
23912391 return -1 ;
23922392
23932393 if ((error = p_stat (git_buf_cstr (& path ), & st )) < 0 ) {
@@ -2408,7 +2408,7 @@ int git_repository_message_remove(git_repository *repo)
24082408 git_buf path = GIT_BUF_INIT ;
24092409 int error ;
24102410
2411- if (git_buf_joinpath (& path , repo -> path_repository , GIT_MERGE_MSG_FILE ) < 0 )
2411+ if (git_buf_joinpath (& path , repo -> gitdir , GIT_MERGE_MSG_FILE ) < 0 )
24122412 return -1 ;
24132413
24142414 error = p_unlink (git_buf_cstr (& path ));
@@ -2650,7 +2650,7 @@ int git_repository_state(git_repository *repo)
26502650
26512651 assert (repo );
26522652
2653- if (git_buf_puts (& repo_path , repo -> path_repository ) < 0 )
2653+ if (git_buf_puts (& repo_path , repo -> gitdir ) < 0 )
26542654 return -1 ;
26552655
26562656 if (git_path_contains_file (& repo_path , GIT_REBASE_MERGE_INTERACTIVE_FILE ))
@@ -2692,7 +2692,7 @@ int git_repository__cleanup_files(
26922692 for (error = 0 , i = 0 ; !error && i < files_len ; ++ i ) {
26932693 const char * path ;
26942694
2695- if (git_buf_joinpath (& buf , repo -> path_repository , files [i ]) < 0 )
2695+ if (git_buf_joinpath (& buf , repo -> gitdir , files [i ]) < 0 )
26962696 return -1 ;
26972697
26982698 path = git_buf_cstr (& buf );
@@ -2736,7 +2736,7 @@ int git_repository_is_shallow(git_repository *repo)
27362736 struct stat st ;
27372737 int error ;
27382738
2739- if ((error = git_buf_joinpath (& path , repo -> path_repository , "shallow" )) < 0 )
2739+ if ((error = git_buf_joinpath (& path , repo -> gitdir , "shallow" )) < 0 )
27402740 return error ;
27412741
27422742 error = git_path_lstat (path .ptr , & st );
0 commit comments