summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cd673c1)
raw | patch | inline | side by side (parent: cd673c1)
author | Junio C Hamano <gitster@pobox.com> | |
Sat, 28 Feb 2009 07:30:38 +0000 (23:30 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 28 Feb 2009 09:06:06 +0000 (01:06 -0800) |
Its "ignore_packed" parameter always comes from struct rev_info. This
patch makes the function take a pointer to the surrounding structure, so
that the refactoring in the next patch becomes easier to review.
There is an unfortunate header file dependency and the easiest workaround
is to temporarily move the function declaration from cache.h to
revision.h; this will be moved back to cache.h once the function loses
this "ignore_packed" parameter altogether in the later part of the
series.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
patch makes the function take a pointer to the surrounding structure, so
that the refactoring in the next patch becomes easier to review.
There is an unfortunate header file dependency and the easiest workaround
is to temporarily move the function declaration from cache.h to
revision.h; this will be moved back to cache.h once the function loses
this "ignore_packed" parameter altogether in the later part of the
series.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h | patch | blob | history | |
revision.c | patch | blob | history | |
revision.h | patch | blob | history | |
sha1_file.c | patch | blob | history |
index c1539bf89a620cf8b86ca9cef37238e9df18144f..8e43f382e8a4a0b3f01b50c054709d38fe034b9f 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -566,7 +566,6 @@ extern int check_sha1_signature(const unsigned char *sha1, void *buf, unsigned l
extern int move_temp_to_file(const char *tmpfile, const char *filename);
extern int has_sha1_pack(const unsigned char *sha1);
-extern int has_sha1_kept_pack(const unsigned char *sha1, const char **ignore);
extern int has_sha1_file(const unsigned char *sha1);
extern int has_loose_object_nonlocal(const unsigned char *sha1);
diff --git a/revision.c b/revision.c
index 746eeed972794e7ad50fcc097afd3bf280674e5a..795e0c03fef4c95cc0d45cb1515f38d8db8211eb 100644 (file)
--- a/revision.c
+++ b/revision.c
@@ -1486,7 +1486,7 @@ enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit)
if (commit->object.flags & SHOWN)
return commit_ignore;
if (revs->unpacked &&
- has_sha1_kept_pack(commit->object.sha1, revs->ignore_packed))
+ has_sha1_kept_pack(commit->object.sha1, revs))
return commit_ignore;
if (revs->show_all)
return commit_show;
diff --git a/revision.h b/revision.h
index 91f194478bb91d381ab2b2440215144d8bb8d18d..930429625f6d35dd195c3bc6147cc985b6746e51 100644 (file)
--- a/revision.h
+++ b/revision.h
extern enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit);
+extern int has_sha1_kept_pack(const unsigned char *sha1, const struct rev_info *);
+
#endif
diff --git a/sha1_file.c b/sha1_file.c
index ac4375d298eb12602e35337f378fd22278695f7d..f963c3cadbb45b47310818eb63df292d91d8dca1 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
#include "refs.h"
#include "pack-revindex.h"
#include "sha1-lookup.h"
+#include "diff.h"
+#include "revision.h"
#ifndef O_NOATIME
#if defined(__linux__) && (defined(__i386__) || defined(__PPC__))
}
static int find_pack_ent(const unsigned char *sha1, struct pack_entry *e,
- const char **ignore_packed)
+ const struct rev_info *revs)
{
static struct packed_git *last_found = (void *)1;
struct packed_git *p;
p = (last_found == (void *)1) ? packed_git : last_found;
do {
- if (ignore_packed) {
+ if (revs->ignore_packed) {
const char **ig;
- for (ig = ignore_packed; *ig; ig++)
+ for (ig = revs->ignore_packed; *ig; ig++)
if (matches_pack_name(p, *ig))
break;
if (*ig)
}
static int find_kept_pack_entry(const unsigned char *sha1, struct pack_entry *e,
- const char **ignore_packed)
+ const struct rev_info *revs)
{
- return find_pack_ent(sha1, e, ignore_packed);
+ return find_pack_ent(sha1, e, revs);
}
struct packed_git *find_sha1_pack(const unsigned char *sha1,
return find_pack_entry(sha1, &e);
}
-int has_sha1_kept_pack(const unsigned char *sha1, const char **ignore_packed)
+int has_sha1_kept_pack(const unsigned char *sha1, const struct rev_info *revs)
{
struct pack_entry e;
- return find_kept_pack_entry(sha1, &e, ignore_packed);
+ return find_kept_pack_entry(sha1, &e, revs);
}
int has_sha1_file(const unsigned char *sha1)