Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-fsck.c')
-rw-r--r--builtin-fsck.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin-fsck.c b/builtin-fsck.c
index 4e5aa33dfb..4d8b66c344 100644
--- a/builtin-fsck.c
+++ b/builtin-fsck.c
@@ -14,6 +14,7 @@
static int show_root;
static int show_tags;
static int show_unreachable;
+static int include_reflogs = 1;
static int check_full;
static int check_strict;
static int keep_cache_objects;
@@ -517,7 +518,8 @@ static int fsck_handle_ref(const char *refname, const unsigned char *sha1, int f
static void get_default_heads(void)
{
for_each_ref(fsck_handle_ref, NULL);
- for_each_reflog(fsck_handle_reflog, NULL);
+ if (include_reflogs)
+ for_each_reflog(fsck_handle_reflog, NULL);
/*
* Not having any default heads isn't really fatal, but
@@ -616,6 +618,10 @@ int cmd_fsck(int argc, char **argv, const char *prefix)
keep_cache_objects = 1;
continue;
}
+ if (!strcmp(arg, "--no-reflogs")) {
+ include_reflogs = 0;
+ continue;
+ }
if (!strcmp(arg, "--full")) {
check_full = 1;
continue;