summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d4bb43e)
raw | patch | inline | side by side (parent: d4bb43e)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 17 Sep 2007 06:15:19 +0000 (23:15 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 17 Sep 2007 19:25:26 +0000 (12:25 -0700) |
The function sounds boolean; make it behave as one, not "0 for
success, non-zero for failure".
Signed-off-by: Junio C Hamano <gitster@pobox.com>
success, non-zero for failure".
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h | patch | blob | history | |
sha1_file.c | patch | blob | history |
index 70abbd59bf8d3ca118836605099b0b5dc66a27b7..3fa5b8e6a83bd8dc9d5e27e2b572e0e4a681d415 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -529,6 +529,7 @@ extern void *unpack_entry(struct packed_git *, off_t, enum object_type *, unsign
extern unsigned long unpack_object_header_gently(const unsigned char *buf, unsigned long len, enum object_type *type, unsigned long *sizep);
extern unsigned long get_size_from_delta(struct packed_git *, struct pack_window **, off_t);
extern const char *packed_object_info_detail(struct packed_git *, off_t, unsigned long *, unsigned long *, unsigned int *, unsigned char *);
+extern int matches_pack_name(struct packed_git *p, const char *name);
/* Dumb servers support */
extern int update_server_info(int);
diff --git a/sha1_file.c b/sha1_file.c
index 9978a58da68bbf6f3482545d9f290fbfa3f3fe34..5801c3e71b43d80f7d65b21b100775b23455f533 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
return 0;
}
-static int matches_pack_name(struct packed_git *p, const char *ig)
+int matches_pack_name(struct packed_git *p, const char *name)
{
const char *last_c, *c;
- if (!strcmp(p->pack_name, ig))
- return 0;
+ if (!strcmp(p->pack_name, name))
+ return 1;
for (c = p->pack_name, last_c = c; *c;)
if (*c == '/')
last_c = ++c;
else
++c;
- if (!strcmp(last_c, ig))
- return 0;
+ if (!strcmp(last_c, name))
+ return 1;
- return 1;
+ return 0;
}
static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e, const char **ignore_packed)
@@ -1717,7 +1717,7 @@ static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e, cons
if (ignore_packed) {
const char **ig;
for (ig = ignore_packed; *ig; ig++)
- if (!matches_pack_name(p, *ig))
+ if (matches_pack_name(p, *ig))
break;
if (*ig)
goto next;