diff options
Diffstat (limited to 'third_party/git/builtin/reflog.c')
-rw-r--r-- | third_party/git/builtin/reflog.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/third_party/git/builtin/reflog.c b/third_party/git/builtin/reflog.c index 81dfd563c0d9..4d3430900d06 100644 --- a/third_party/git/builtin/reflog.c +++ b/third_party/git/builtin/reflog.c @@ -560,16 +560,15 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix) for (i = 1; i < argc; i++) { const char *arg = argv[i]; - if (!strcmp(arg, "--dry-run") || !strcmp(arg, "-n")) flags |= EXPIRE_REFLOGS_DRY_RUN; - else if (skip_prefix(arg, "--expire=", &arg)) { - if (parse_expiry_date(arg, &cb.cmd.expire_total)) + else if (starts_with(arg, "--expire=")) { + if (parse_expiry_date(arg + 9, &cb.cmd.expire_total)) die(_("'%s' is not a valid timestamp"), arg); explicit_expiry |= EXPIRE_TOTAL; } - else if (skip_prefix(arg, "--expire-unreachable=", &arg)) { - if (parse_expiry_date(arg, &cb.cmd.expire_unreachable)) + else if (starts_with(arg, "--expire-unreachable=")) { + if (parse_expiry_date(arg + 21, &cb.cmd.expire_unreachable)) die(_("'%s' is not a valid timestamp"), arg); explicit_expiry |= EXPIRE_UNREACH; } |