]> asedeno.scripts.mit.edu Git - git.git/blobdiff - date.c
push: mention "git pull" in error message for non-fast forwards
[git.git] / date.c
diff --git a/date.c b/date.c
index 610ecf75075aee90eabf65d198f7a28ba629a970..3c981f7eb5ebaed1ba621f3d4cd960f14145b97a 100644 (file)
--- a/date.c
+++ b/date.c
@@ -229,6 +229,7 @@ static const struct {
 
        { "GMT",    0, 0, },    /* Greenwich Mean */
        { "UTC",    0, 0, },    /* Universal (Coordinated) */
+       { "Z",      0, 0, },    /* Zulu, alias for UTC */
 
        { "WET",    0, 0, },    /* Western European */
        { "BST",    0, 1, },    /* British Summer */
@@ -305,7 +306,7 @@ static int match_alpha(const char *date, struct tm *tm, int *offset)
 
        for (i = 0; i < ARRAY_SIZE(timezone_names); i++) {
                int match = match_string(date, timezone_names[i].name);
-               if (match >= 3) {
+               if (match >= 3 || match == strlen(timezone_names[i].name)) {
                        int off = timezone_names[i].offset;
 
                        /* This is bogus, but we like summer */
@@ -634,7 +635,7 @@ int parse_date_toffset(const char *date, unsigned long *timestamp, int *offset)
        /* mktime uses local timezone */
        *timestamp = tm_to_time_t(&tm);
        if (*offset == -1)
-               *offset = (*timestamp - mktime(&tm)) / 60;
+               *offset = ((time_t)*timestamp - mktime(&tm)) / 60;
 
        if (*timestamp == -1)
                return -1;