summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e00de24)
raw | patch | inline | side by side (parent: e00de24)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Fri, 9 Feb 2007 00:28:23 +0000 (01:28 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 9 Feb 2007 01:48:22 +0000 (17:48 -0800) |
Since "git log origin/master" uses dwim_log() to match
"refs/remotes/origin/master", it makes sense to do that for
"git log --reflog", too.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
"refs/remotes/origin/master", it makes sense to do that for
"git log --reflog", too.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
cache.h | patch | blob | history | |
reflog-walk.c | patch | blob | history | |
sha1_name.c | patch | blob | history |
index 87142571b3a7abe7772386afebad73e69ac9540e..c62b0b090d2b3e628764557127f1629d26459fbf 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -302,6 +302,7 @@ extern char *sha1_to_hex(const unsigned char *sha1); /* static buffer result! */
extern int read_ref(const char *filename, unsigned char *sha1);
extern const char *resolve_ref(const char *path, unsigned char *sha1, int, int *);
extern int dwim_ref(const char *str, int len, unsigned char *sha1, char **ref);
+extern int dwim_log(const char *str, int len, unsigned char *sha1, char **ref);
extern int create_symref(const char *ref, const char *refs_heads_master, const char *logmsg);
extern int validate_headref(const char *ref);
diff --git a/reflog-walk.c b/reflog-walk.c
index afe1577d76ebd06e323d478f616c838142fa02d0..c983858259f717b3ed9d0f00921aec92219c1ad3 100644 (file)
--- a/reflog-walk.c
+++ b/reflog-walk.c
branch = xstrdup(head);
}
reflogs = read_complete_reflog(branch);
+ if (!reflogs || reflogs->nr == 0) {
+ unsigned char sha1[20];
+ char *b;
+ if (dwim_log(branch, strlen(branch), sha1, &b) == 1) {
+ if (reflogs) {
+ free(reflogs->ref);
+ free(reflogs);
+ }
+ free(branch);
+ branch = b;
+ reflogs = read_complete_reflog(branch);
+ }
+ }
if (!reflogs || reflogs->nr == 0)
die("No reflogs found for '%s'", branch);
path_list_insert(branch, &info->complete_reflogs)->util
diff --git a/sha1_name.c b/sha1_name.c
index d77f77097f6e00615732c5e6d50a2c594bef4311..f79a7c9fb84d5600544b64b9d9ecef2699804551 100644 (file)
--- a/sha1_name.c
+++ b/sha1_name.c
return refs_found;
}
-static int dwim_log(const char *str, int len, unsigned char *sha1, char **log)
+int dwim_log(const char *str, int len, unsigned char *sha1, char **log)
{
const char **p;
int logs_found = 0;