improve 'got add' error message if file does not exist; reported by Timo Myyrä ok tracey
diff --git a/lib/worktree.c b/lib/worktree.c
index 02ace08..610c0eb 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -3874,7 +3874,10 @@ schedule_addition(void *arg, unsigned char status, unsigned char staged_status,
}
if (status != GOT_STATUS_UNVERSIONED) {
- err = got_error_path(ondisk_path, GOT_ERR_FILE_STATUS);
+ if (status == GOT_STATUS_NONEXISTENT)
+ err = got_error_set_errno(ENOENT, ondisk_path);
+ else
+ err = got_error_path(ondisk_path, GOT_ERR_FILE_STATUS);
goto done;
}