aboutsummaryrefslogtreecommitdiff
path: root/builtin-fsck.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-02-04 16:54:47 -0800
committerJunio C Hamano <junkio@cox.net>2007-02-04 16:54:47 -0800
commitd1f289c5aa52bb77dc4959fb21cef032d954869f (patch)
tree525c95c67c6ae06278a99f244dc5d120c45a8747 /builtin-fsck.c
parent6e2e1cfb81a6a6de9fc074bd26bed8a45f73251f (diff)
parent632ac9fd12a2d4ff2c1a1fcd63492ce24315221f (diff)
downloadgit-d1f289c5aa52bb77dc4959fb21cef032d954869f.tar.gz
git-d1f289c5aa52bb77dc4959fb21cef032d954869f.tar.xz
Merge branch 'np/dreflog'
* np/dreflog: show-branch -g: default to the current branch. Let git-checkout always drop any detached head Enable HEAD@{...} and make it independent from the current branch scan reflogs independently from refs add reflog when moving HEAD to a new branch create_symref(): do not assume pathname from git_path() persists long enough add logref support to git-symbolic-ref move create_symref() past log_ref_write() add reflog entries for HEAD when detached enable separate reflog for HEAD lock_ref_sha1_basic(): remember the original name of a ref when resolving it make reflog filename independent from struct ref_lock
Diffstat (limited to 'builtin-fsck.c')
-rw-r--r--builtin-fsck.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin-fsck.c b/builtin-fsck.c
index f6f196744..6da3814d5 100644
--- a/builtin-fsck.c
+++ b/builtin-fsck.c
@@ -477,6 +477,12 @@ static int fsck_handle_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
return 0;
}
+static int fsck_handle_reflog(const char *logname, const unsigned char *sha1, int flag, void *cb_data)
+{
+ for_each_reflog_ent(logname, fsck_handle_reflog_ent, NULL);
+ return 0;
+}
+
static int fsck_handle_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data)
{
struct object *obj;
@@ -495,14 +501,13 @@ static int fsck_handle_ref(const char *refname, const unsigned char *sha1, int f
obj->used = 1;
mark_reachable(obj, REACHABLE);
- for_each_reflog_ent(refname, fsck_handle_reflog_ent, NULL);
-
return 0;
}
static void get_default_heads(void)
{
for_each_ref(fsck_handle_ref, NULL);
+ for_each_reflog(fsck_handle_reflog, NULL);
/*
* Not having any default heads isn't really fatal, but