Move git__date_parse declaration to util.h.
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
diff --git a/src/date.c b/src/date.c
index a2f3698..5529dc2 100644
--- a/src/date.c
+++ b/src/date.c
@@ -10,7 +10,7 @@
#include <sys/time.h>
#endif
-#include "date.h"
+#include "util.h"
#include "cache.h"
#include "posix.h"
diff --git a/src/date.h b/src/date.h
deleted file mode 100644
index 6859ee5..0000000
--- a/src/date.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright (C) 2009-2012 the libgit2 contributors
- *
- * This file is part of libgit2, distributed under the GNU GPL v2 with
- * a Linking Exception. For full terms see the included COPYING file.
- */
-#ifndef INCLUDE_date_h__
-#define INCLUDE_date_h__
-
-#include "git2/types.h"
-
-int git__date_parse(git_time_t *out, const char *date);
-
-#endif
diff --git a/src/revparse.c b/src/revparse.c
index a6f2a15..3312345 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -9,7 +9,6 @@
#include "common.h"
#include "buffer.h"
-#include "date.h"
#include "tree.h"
#include "git2.h"
diff --git a/src/util.h b/src/util.h
index c4a55f5..eed2bc8 100644
--- a/src/util.h
+++ b/src/util.h
@@ -230,4 +230,14 @@ GIT_INLINE(bool) git__iswildcard(int c)
*/
extern int git__parse_bool(int *out, const char *value);
+/*
+ * Parse a string into a value as a git_time_t.
+ *
+ * Sample valid input:
+ * - "yesterday"
+ * - "July 17, 2003"
+ * - "2003-7-17 08:23"
+ */
+int git__date_parse(git_time_t *out, const char *date);
+
#endif /* INCLUDE_util_h__ */
diff --git a/tests-clar/date/date.c b/tests-clar/date/date.c
index 1018a13..d44ef85 100644
--- a/tests-clar/date/date.c
+++ b/tests-clar/date/date.c
@@ -1,6 +1,6 @@
#include "clar_libgit2.h"
-#include "date.h"
+#include "util.h"
void test_date_date__overflow(void)
{