summaryrefslogtreecommitdiff
path: root/http-fetch.c
diff options
context:
space:
mode:
authorRene Scharfe <rene.scharfe@lsrfire.ath.cx>2006-08-10 15:02:30 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-08-10 21:13:53 (GMT)
commit83a2b841d6b90e6f4b797df40ed3a105364574b6 (patch)
tree06b21e14a70cde595570d2b7948245b26995dbb8 /http-fetch.c
parent242abf106c6929028c2dc916504879885cd64d4d (diff)
downloadgit-83a2b841d6b90e6f4b797df40ed3a105364574b6.zip
git-83a2b841d6b90e6f4b797df40ed3a105364574b6.tar.gz
git-83a2b841d6b90e6f4b797df40ed3a105364574b6.tar.bz2
Add has_extension()
The little helper has_extension() documents through its name what we are trying to do and makes sure we don't forget the underrun check. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'http-fetch.c')
-rw-r--r--http-fetch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/http-fetch.c b/http-fetch.c
index 36af3e5..6ea39f0 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -870,7 +870,7 @@ static void process_ls_pack(struct remote_ls_ctx *ls)
if (strlen(ls->dentry_name) == 63 &&
!strncmp(ls->dentry_name, "objects/pack/pack-", 18) &&
- !strncmp(ls->dentry_name+58, ".pack", 5)) {
+ has_extension(ls->dentry_name, 63, ".pack")) {
get_sha1_hex(ls->dentry_name + 18, sha1);
setup_index(ls->repo, sha1);
}