git-mv: succeed even if source is a prefix of destination
[gitweb.git] / index-pack.c
index b39953dc698aae25f79caa9553e13bca6cd4e986..b20659c2591f2669e03570c9809249b37ec58c38 100644 (file)
@@ -447,7 +447,7 @@ int main(int argc, char **argv)
                usage(index_pack_usage);
        if (!index_name) {
                int len = strlen(pack_name);
-               if (len < 5 || strcmp(pack_name + len - 5, ".pack"))
+               if (!has_extension(pack_name, ".pack"))
                        die("packfile name '%s' does not end with '.pack'",
                            pack_name);
                index_name_buf = xmalloc(len);