summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 47c9739)
raw | patch | inline | side by side (parent: 47c9739)
author | Christian Couder <chriscool@tuxfamily.org> | |
Sat, 9 May 2009 15:55:38 +0000 (17:55 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 10 May 2009 21:30:16 +0000 (14:30 -0700) |
This patch creates a "struct sha1_array" to store skipped revisions,
so that the same struct can be reused in a later patch for good
revisions.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
so that the same struct can be reused in a later patch for good
revisions.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bisect.c | patch | blob | history |
diff --git a/bisect.c b/bisect.c
index 4796aa919870d49f67ad23dded2ce5b654841c87..12df855cfa970971ff2340a9cd0ae7a1de044e7d 100644 (file)
--- a/bisect.c
+++ b/bisect.c
#include "run-command.h"
#include "bisect.h"
-static unsigned char (*skipped_sha1)[20];
-static int skipped_sha1_nr;
-static int skipped_sha1_alloc;
+struct sha1_array {
+ unsigned char (*sha1)[20];
+ int sha1_nr;
+ int sha1_alloc;
+};
+
+static struct sha1_array skipped_revs;
static const char **rev_argv;
static int rev_argv_nr;
ALLOC_GROW(rev_argv, rev_argv_nr + 1, rev_argv_alloc);
rev_argv[rev_argv_nr++] = good;
} else if (!prefixcmp(refname, "skip-")) {
- ALLOC_GROW(skipped_sha1, skipped_sha1_nr + 1,
- skipped_sha1_alloc);
- hashcpy(skipped_sha1[skipped_sha1_nr++], sha1);
+ ALLOC_GROW(skipped_revs.sha1, skipped_revs.sha1_nr + 1,
+ skipped_revs.sha1_alloc);
+ hashcpy(skipped_revs.sha1[skipped_revs.sha1_nr++], sha1);
}
return 0;
static void prepare_skipped(void)
{
- qsort(skipped_sha1, skipped_sha1_nr, sizeof(*skipped_sha1), skipcmp);
+ qsort(skipped_revs.sha1, skipped_revs.sha1_nr,
+ sizeof(*skipped_revs.sha1), skipcmp);
}
static const unsigned char *skipped_sha1_access(size_t index, void *table)
static int lookup_skipped(unsigned char *sha1)
{
- return sha1_pos(sha1, skipped_sha1, skipped_sha1_nr,
+ return sha1_pos(sha1, skipped_revs.sha1, skipped_revs.sha1_nr,
skipped_sha1_access);
}
*tried = NULL;
- if (!skipped_sha1_nr)
+ if (!skipped_revs.sha1_nr)
return list;
prepare_skipped();
mark_edges_uninteresting(revs->commits, revs, NULL);
revs->commits = find_bisection(revs->commits, reaches, all,
- !!skipped_sha1_nr);
+ !!skipped_revs.sha1_nr);
}
static void exit_if_skipped_commits(struct commit_list *tried,