File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -623,6 +623,24 @@ void cl_fake_globalconfig(git_str *out)
623623 git_str_dispose (& path );
624624}
625625
626+ void cl_sandbox_set_homedir (const char * home )
627+ {
628+ git_str path = GIT_STR_INIT ;
629+
630+ if (home ) {
631+ git_libgit2_opts (GIT_OPT_SET_HOMEDIR , home );
632+ } else {
633+ git_str_joinpath (& path , clar_sandbox_path (), "__home" );
634+
635+ if (!git_fs_path_exists (path .ptr ))
636+ cl_must_pass (p_mkdir (path .ptr , 0777 ));
637+
638+ git_libgit2_opts (GIT_OPT_SET_HOMEDIR , path .ptr );
639+ }
640+
641+ git_str_dispose (& path );
642+ }
643+
626644void cl_sandbox_set_search_path_defaults (void )
627645{
628646 git_str path = GIT_STR_INIT ;
Original file line number Diff line number Diff line change @@ -249,6 +249,7 @@ void cl_fake_homedir_cleanup(void *);
249249void cl_fake_globalconfig (git_str * );
250250void cl_fake_globalconfig_cleanup (void * );
251251
252+ void cl_sandbox_set_homedir (const char * );
252253void cl_sandbox_set_search_path_defaults (void );
253254void cl_sandbox_disable_ownership_validation (void );
254255
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ int main(int argc, char *argv[])
2525 }
2626
2727 cl_global_trace_register ();
28+ cl_sandbox_set_homedir (getenv ("CLAR_HOMEDIR" ));
2829 cl_sandbox_set_search_path_defaults ();
2930 cl_sandbox_disable_ownership_validation ();
3031
You can’t perform that action at this time.
0 commit comments