submodule: port resolve_relative_url from shell to C
[gitweb.git] / builtin / repack.c
index 70b9b1eaf17f5447021f7174f31e5c19d9754486..858db38f52e878a41cefdd47bbafd1250c7483b0 100644 (file)
@@ -193,6 +193,9 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
        argc = parse_options(argc, argv, prefix, builtin_repack_options,
                                git_repack_usage, 0);
 
+       if (delete_redundant && repository_format_precious_objects)
+               die(_("cannot delete packs in a precious-objects repo"));
+
        if (pack_kept_objects < 0)
                pack_kept_objects = write_bitmaps;
 
@@ -263,7 +266,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
                return ret;
 
        out = xfdopen(cmd.out, "r");
-       while (strbuf_getline(&line, out, '\n') != EOF) {
+       while (strbuf_getline_lf(&line, out) != EOF) {
                if (line.len != 40)
                        die("repack: Expecting 40 character sha1 lines only from pack-objects.");
                string_list_append(&names, line.buf);