summaryrefslogtreecommitdiff
path: root/daemon.c
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2008-12-26 10:01:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-12-27 03:08:32 (GMT)
commita583971f15e520c8cb5f9967383903e13c353c86 (patch)
treec1eb95823fe439397eff0da2eb9985718fd955d6 /daemon.c
parentc569b1fee151e467854ca268997f4f3baaf73564 (diff)
downloadgit-a583971f15e520c8cb5f9967383903e13c353c86.zip
git-a583971f15e520c8cb5f9967383903e13c353c86.tar.gz
git-a583971f15e520c8cb5f9967383903e13c353c86.tar.bz2
daemon: cleanup: replace loop with if
Replace a loop around an enter_repo() call, which was used to retry a single time with a different parameter in case the first call fails, with two calls and an if. This is shorter and cleaner. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'daemon.c')
-rw-r--r--daemon.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/daemon.c b/daemon.c
index 8c317be..4468fb9 100644
--- a/daemon.c
+++ b/daemon.c
@@ -150,7 +150,6 @@ static char *path_ok(char *directory)
{
static char rpath[PATH_MAX];
static char interp_path[PATH_MAX];
- int retried_path = 0;
char *path;
char *dir;
@@ -219,22 +218,15 @@ static char *path_ok(char *directory)
dir = rpath;
}
- do {
- path = enter_repo(dir, strict_paths);
- if (path)
- break;
-
+ path = enter_repo(dir, strict_paths);
+ if (!path && base_path && base_path_relaxed) {
/*
* if we fail and base_path_relaxed is enabled, try without
* prefixing the base path
*/
- if (base_path && base_path_relaxed && !retried_path) {
- dir = directory;
- retried_path = 1;
- continue;
- }
- break;
- } while (1);
+ dir = directory;
+ path = enter_repo(dir, strict_paths);
+ }
if (!path) {
logerror("'%s': unable to chdir or not a git archive", dir);