From: Pieter de Bie Date: Sun, 10 Aug 2008 20:22:21 +0000 (+0200) Subject: builtin-reflog: Allow reflog expire to name partial ref X-Git-Tag: v1.6.1-rc1~328^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=90fb46ec83cd837364592ce4d95055a3b6fe89a4;p=git.git builtin-reflog: Allow reflog expire to name partial ref This allows you to specify 'git reflog expire master' without needing to give the full refname like 'git reflog expire refs/heads/master' Signed-off-by: Pieter de Bie Signed-off-by: Junio C Hamano --- diff --git a/builtin-reflog.c b/builtin-reflog.c index 196fa03b7..6b3667ef0 100644 --- a/builtin-reflog.c +++ b/builtin-reflog.c @@ -540,11 +540,11 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix) free(collected.e); } - while (i < argc) { - const char *ref = argv[i++]; + for (; i < argc; i++) { + char *ref; unsigned char sha1[20]; - if (!resolve_ref(ref, sha1, 1, NULL)) { - status |= error("%s points nowhere!", ref); + if (!dwim_log(argv[i], strlen(argv[i]), sha1, &ref)) { + status |= error("%s points nowhere!", argv[i]); continue; } set_reflog_expiry_param(&cb, explicit_expiry, ref);