summaryrefslogtreecommitdiff
path: root/builtin/init-db.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2014-01-06 14:45:25 +0100
committerJunio C Hamano <gitster@pobox.com>2014-01-06 09:34:21 -0800
commit0be0521b23f46dac586e1b464fafe8b97027b645 (patch)
treecc77526800270ba7e2d569ad94f2d31e16ca87c0 /builtin/init-db.c
parent9e6f885d146c58b23b166a99b93f115735b7bf22 (diff)
downloadgit-0be0521b23f46dac586e1b464fafe8b97027b645.tar.gz
safe_create_leading_directories(): introduce enum for return values
Instead of returning magic integer values (which a couple of callers go to the trouble of distinguishing), return values from an enum. Add a docstring. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/init-db.c')
-rw-r--r--builtin/init-db.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 78aa3872dd..0bc14f3c81 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -515,10 +515,10 @@ 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_EXISTS:
errno = EEXIST;
/* fallthru */
- case -1:
+ case SCLD_FAILED:
die_errno(_("cannot mkdir %s"), argv[0]);
break;
default: