Commit eecfbcd1f57266e4d9f0d6a45e2cd968aa527630

Stefan Sperling 2018-12-29T15:14:24

introduce macros for status codes

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 {