summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-11-03 05:41:47 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-11-03 05:41:47 (GMT)
commitaac91b7eeae4e8cf6521a5370caf03eb432ce492 (patch)
tree7542e33984d341d8dbbffb3827c37dfaea4e87cc /sha1_file.c
parent4508dde16951df00529207f179fee405e8646a64 (diff)
parent861ed12106d7f8e65b90c8a5ed4a026cd71a044d (diff)
downloadgit-aac91b7eeae4e8cf6521a5370caf03eb432ce492.zip
git-aac91b7eeae4e8cf6521a5370caf03eb432ce492.tar.gz
git-aac91b7eeae4e8cf6521a5370caf03eb432ce492.tar.bz2
Merge branch 'sp/keep-pack' into np/index-pack
* sp/keep-pack: (29 commits) Remove unused variable in receive-pack. Teach git-index-pack how to keep a pack file. Only repack active packs by skipping over kept packs. Allow short pack names to git-pack-objects --unpacked=. git-send-email: Read the default SMTP server from the GIT config file git-send-email: Document support for local sendmail instead of SMTP server Swap the porcelain and plumbing commands in the git man page Mention that pull can work locally in the synopsis gitweb: Add "next" link to commitdiff view gitweb: Move git_get_last_activity subroutine earlier Documentation: fix git-format-patch mark-up and link it from git.txt Documentation: Update information about <format> in git-for-each-ref Bash completion support for aliases gitweb: Fix up bogus $stylesheet declarations tests: merge-recursive is usable without Python gitweb: Check git base URLs before generating URL from it Documentation: add git in /etc/services. Documentation: add upload-archive service to git-daemon. git-cherry: document limit and add diagram diff-format.txt: Correct information about pathnames quoting in patch format ...
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index e89d24c..5e6c8b8 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1203,6 +1203,24 @@ unsigned long find_pack_entry_one(const unsigned char *sha1,
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;