introduce macros for status codes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/include/got_worktree.h b/include/got_worktree.h
index 72da6f6..aa7c545 100644
--- a/include/got_worktree.h
+++ b/include/got_worktree.h
@@ -16,6 +16,10 @@
struct got_worktree;
+/* status codes */
+#define GOT_STATUS_ADD 'A'
+#define GOT_STATUS_EXISTS 'E'
+
/*
* Attempt to initialize a new work tree on disk.
* The first argument is the path to a directory where the work tree
diff --git a/lib/worktree.c b/lib/worktree.c
index 4579ebe..dd16710 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -430,7 +430,7 @@ add_file_on_disk(struct got_worktree *worktree, struct got_fileindex *fileindex,
err = got_error(GOT_ERR_FILE_OBSTRUCTED);
} else {
/* TODO: Merge the file! */
- (*progress_cb)(progress_arg, 'E',
+ (*progress_cb)(progress_arg, GOT_STATUS_EXISTS,
progress_path);
return NULL;
}
@@ -438,7 +438,7 @@ add_file_on_disk(struct got_worktree *worktree, struct got_fileindex *fileindex,
return err;
}
- (*progress_cb)(progress_arg, 'A', progress_path);
+ (*progress_cb)(progress_arg, GOT_STATUS_ADD, progress_path);
hdrlen = got_object_blob_get_hdrlen(blob);
do {