From b0ceac2594c17b06c1175845757b7a9bba5d1d9a Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Thu, 8 Mar 2012 12:31:01 +0530 Subject: [PATCH] chdirs moved from load() to load_common() and load_1() --- Gitolite/Conf/Load.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Gitolite/Conf/Load.pm b/Gitolite/Conf/Load.pm index db11679..af62812 100644 --- a/Gitolite/Conf/Load.pm +++ b/Gitolite/Conf/Load.pm @@ -43,8 +43,8 @@ my $last_repo = ''; trace( 4, "$repo" ); if ( $repo ne $loaded_repo ) { trace( 3, "loading $repo..." ); - _chdir("$GL_ADMIN_BASE"); load_common(); - _chdir("$GL_REPO_BASE"); load_1($repo); + load_common(); + load_1($repo); $loaded_repo = $repo; } } @@ -86,6 +86,8 @@ sub access { sub load_common { + _chdir("$GL_ADMIN_BASE"); + # we take an unusual approach to caching this function! # (requires that first call to load_common is before first call to load_1) if ( $last_repo and $split_conf{$last_repo} ) { @@ -110,6 +112,8 @@ sub load_1 { my $repo = shift; trace( 4, $repo ); + _chdir("$GL_REPO_BASE"); + if ( $repo eq $last_repo ) { $repos{$repo} = $one_repo{$repo}; $configs{$repo} = $one_config{$repo} if $one_config{$repo};