Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--commit.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/commit.c b/commit.c
index a54b0a0df0..73e883fe45 100644
--- a/commit.c
+++ b/commit.c
@@ -143,6 +143,15 @@ static timestamp_t parse_commit_date(const char *buf, const char *tail)
/*
* We know there is at least one digit (or dash), so we'll begin
* parsing there and stop at worst case at eol.
+ *
+ * Note that we may feed parse_timestamp() extra characters here if the
+ * commit is malformed, and it will parse as far as it can. For
+ * example, "123foo456" would return "123". That might be questionable
+ * (versus returning "0"), but it would help in a hypothetical case
+ * like "123456+0100", where the whitespace from the timezone is
+ * missing. Since such syntactic errors may be baked into history and
+ * hard to correct now, let's err on trying to make our best guess
+ * here, rather than insist on perfect syntax.
*/
return parse_timestamp(dateptr, NULL, 10);
}