use path as name if no name was given
authorChristian Thaeter <ct@pipapo.org>
Mon, 7 Jan 2008 21:09:12 +0000 (22:09 +0100)
committerChristian Thaeter <ct@pipapo.org>
Mon, 7 Jan 2008 21:09:12 +0000 (22:09 +0100)
The former method of using basenames only yielded name clashes

src/repo.c

index 3c4ecf0..02b3d71 100644 (file)
@@ -229,22 +229,9 @@ webgit_repoinfo_new (struct webgit_query* query, const char* path)
   in_flight = self;
   git_config (webgit_repo_conf_cb);
 
+  /* use path, when no name given */
   if (!self->name)
-    {
-      /* strip 'name' out of path when not in .git/config */
-      const char* n;
-      while ((n = strrchr (self->path, '/')))
-        if (n[1])
-          {
-            ++n;
-            break;
-          }
-
-      if (!n)
-        n = self->path;
-
-      self->name = cwa_strndup (n, SIZE_MAX);
-    }
+    self->name = cwa_strndup (self->path, SIZE_MAX);
 
   /* set owner if not already set by gitconfig */
   if (!self->owner)