Code

gitweb: Always display link to blobdiff_plain in git_blobdiff
[git.git] / sha1_file.c
index 51e07d5a45b6740c53bfc7d4b6b11d3f66e07f6e..18dece46b1e248a4e52e9ead3bf172ed6ab78236 100644 (file)
@@ -22,7 +22,7 @@
 #endif
 #endif
 
-const unsigned char null_sha1[20] = { 0, };
+const unsigned char null_sha1[20];
 
 static unsigned int sha1_file_open_flag = O_NOATIME;
 
@@ -590,7 +590,7 @@ static void prepare_packed_git_one(char *objdir, int local)
                int namelen = strlen(de->d_name);
                struct packed_git *p;
 
-               if (strcmp(de->d_name + namelen - 4, ".idx"))
+               if (!has_extension(de->d_name, ".idx"))
                        continue;
 
                /* we have .idx.  Is it a file we can map? */