summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-09-17 06:15:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-09-17 19:25:26 (GMT)
commit000dfd3f6e3f61e15ccfd4cecb3a51624adfbf38 (patch)
treee10a41b5c23d95603755aa0e968e98292d3eb1da /sha1_file.c
parentd4bb43ee273528064192848165f93f8fc3512be1 (diff)
downloadgit-000dfd3f6e3f61e15ccfd4cecb3a51624adfbf38.zip
git-000dfd3f6e3f61e15ccfd4cecb3a51624adfbf38.tar.gz
git-000dfd3f6e3f61e15ccfd4cecb3a51624adfbf38.tar.bz2
Export matches_pack_name() and fix its return value
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>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 9978a58..5801c3e 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1684,22 +1684,22 @@ off_t find_pack_entry_one(const unsigned char *sha1,
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;