summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6dcfa30)
raw | patch | inline | side by side (parent: 6dcfa30)
author | Shawn Pearce <spearce@spearce.org> | |
Sun, 29 Oct 2006 09:37:11 +0000 (04:37 -0500) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 29 Oct 2006 20:46:21 +0000 (12:46 -0800) |
This allows us to pass just the file name of a pack rather than
the complete path when we want pack-objects to consider its
contents as though they were loose objects. This can be helpful
if $GIT_OBJECT_DIRECTORY contains shell metacharacters which make
it cumbersome to pass complete paths safely in a shell script.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
the complete path when we want pack-objects to consider its
contents as though they were loose objects. This can be helpful
if $GIT_OBJECT_DIRECTORY contains shell metacharacters which make
it cumbersome to pass complete paths safely in a shell script.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
sha1_file.c | patch | blob | history |
diff --git a/sha1_file.c b/sha1_file.c
index e89d24c01595aa8ea6c6306928639b40f3313a50..5e6c8b8bbfec7c9b6f60a96d64db0cd6e97904ae 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
return 0;
}
+static int matches_pack_name(struct packed_git *p, const char *ig)
+{
+ const char *last_c, *c;
+
+ if (!strcmp(p->pack_name, ig))
+ return 0;
+
+ for (c = p->pack_name, last_c = c; *c;)
+ if (*c == '/')
+ last_c = ++c;
+ else
+ ++c;
+ if (!strcmp(last_c, ig))
+ return 0;
+
+ return 1;
+}
+
static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e, const char **ignore_packed)
{
struct packed_git *p;
@@ -1214,7 +1232,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 (!strcmp(p->pack_name, *ig))
+ if (!matches_pack_name(p, *ig))
break;
if (*ig)
continue;