summaryrefslogtreecommitdiff
path: root/builtin-reflog.c
diff options
context:
space:
mode:
authorPieter de Bie <pdebie@ai.rug.nl>2008-08-10 22:22:21 +0200
committerJunio C Hamano <gitster@pobox.com>2008-08-17 16:24:46 -0700
commit90fb46ec83cd837364592ce4d95055a3b6fe89a4 (patch)
treec8445fe73eeb79f1a24b0c04124329ba62e3aad6 /builtin-reflog.c
parent2ebc02d32a4360da2cf69c2b5f5bfad0716d42b0 (diff)
downloadgit-90fb46ec83cd837364592ce4d95055a3b6fe89a4.tar.gz
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>
Diffstat (limited to 'builtin-reflog.c')
-rw-r--r--builtin-reflog.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin-reflog.c b/builtin-reflog.c
index 196fa03b7f..6b3667ef0e 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);