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 <pdebie@ai.rug.nl> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
2ebc02d32a
commit
90fb46ec83
|
@ -540,11 +540,11 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
|
||||||
free(collected.e);
|
free(collected.e);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (i < argc) {
|
for (; i < argc; i++) {
|
||||||
const char *ref = argv[i++];
|
char *ref;
|
||||||
unsigned char sha1[20];
|
unsigned char sha1[20];
|
||||||
if (!resolve_ref(ref, sha1, 1, NULL)) {
|
if (!dwim_log(argv[i], strlen(argv[i]), sha1, &ref)) {
|
||||||
status |= error("%s points nowhere!", ref);
|
status |= error("%s points nowhere!", argv[i]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
set_reflog_expiry_param(&cb, explicit_expiry, ref);
|
set_reflog_expiry_param(&cb, explicit_expiry, ref);
|
||||||
|
|
Loading…
Reference in New Issue