read-cache: be specific what part of the index has changed
[gitweb.git] / builtin / init-db.c
index b3f03cf0d6c0f776b2eaba8ff4e1d340216a4463..56f85e239ae0d2607c38e3c46013007ba9e71b12 100644 (file)
@@ -412,11 +412,9 @@ int init_db(const char *template_dir, unsigned int flags)
        if (!(flags & INIT_DB_QUIET)) {
                int len = strlen(git_dir);
 
-               /*
-                * TRANSLATORS: The first '%s' is either "Reinitialized
-                * existing" or "Initialized empty", the second " shared" or
-                * "", and the last '%s%s' is the verbatim directory name.
-                */
+               /* TRANSLATORS: The first '%s' is either "Reinitialized
+                  existing" or "Initialized empty", the second " shared" or
+                  "", and the last '%s%s' is the verbatim directory name. */
                printf(_("%s%s Git repository in %s%s\n"),
                       reinit ? _("Reinitialized existing") : _("Initialized empty"),
                       shared_repository ? _(" shared") : "",
@@ -515,13 +513,14 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
                                saved = shared_repository;
                                shared_repository = 0;
                                switch (safe_create_leading_directories_const(argv[0])) {
-                               case -3:
+                               case SCLD_OK:
+                               case SCLD_PERMS:
+                                       break;
+                               case SCLD_EXISTS:
                                        errno = EEXIST;
                                        /* fallthru */
-                               case -1:
-                                       die_errno(_("cannot mkdir %s"), argv[0]);
-                                       break;
                                default:
+                                       die_errno(_("cannot mkdir %s"), argv[0]);
                                        break;
                                }
                                shared_repository = saved;