]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jn/eoie-ieot'
authorJunio C Hamano <gitster@pobox.com>
Wed, 21 Nov 2018 11:39:02 +0000 (20:39 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 21 Nov 2018 11:39:02 +0000 (20:39 +0900)
As the warning message shown by existing versions of Git for
unknown index extensions is a bit too alarming, two new extensions
are held back and not written by default for the upcoming release.

* jn/eoie-ieot:
  index: make index.threads=true enable ieot and eoie
  ieot: default to not writing IEOT section
  eoie: default to not writing EOIE section

builtin/pack-objects.c
builtin/rebase.c
git-compat-util.h
git-legacy-rebase.sh
pack-objects.h

index e7ea206c08c6d4e81c3649e3988faf4794ce013c..411aefd6875b2d35ee4a12d1a043ba50027021b3 100644 (file)
@@ -2786,9 +2786,11 @@ static void show_object(struct object *obj, const char *name, void *data)
 
        if (use_delta_islands) {
                const char *p;
-               unsigned depth = 0;
+               unsigned depth;
                struct object_entry *ent;
 
+               /* the empty string is a root tree, which is depth 0 */
+               depth = *name ? 1 : 0;
                for (p = strchr(name, '/'); p; p = strchr(p + 1, '/'))
                        depth++;
 
index 1a2758756af6918314dccb74aa691da403fb4132..5b3e5baec8a09fb19798c71b201d08f88225e7af 100644 (file)
@@ -582,7 +582,8 @@ static int reset_head(struct object_id *oid, const char *action,
        }
 
        if (!reset_hard && !fill_tree_descriptor(&desc[nr++], &head_oid)) {
-               ret = error(_("failed to find tree of %s"), oid_to_hex(oid));
+               ret = error(_("failed to find tree of %s"),
+                           oid_to_hex(&head_oid));
                goto leave_reset_head;
        }
 
index f16058182f76bcb9fe50e00a239993de0fb28b12..09b0102cae8c8c0e39dc239003ca599a896730cf 100644 (file)
@@ -861,6 +861,7 @@ extern FILE *fopen_or_warn(const char *path, const char *mode);
 #define FREE_AND_NULL(p) do { free(p); (p) = NULL; } while (0)
 
 #define ALLOC_ARRAY(x, alloc) (x) = xmalloc(st_mult(sizeof(*(x)), (alloc)))
+#define CALLOC_ARRAY(x, alloc) (x) = xcalloc((alloc), sizeof(*(x)));
 #define REALLOC_ARRAY(x, alloc) (x) = xrealloc((x), st_mult(sizeof(*(x)), (alloc)))
 
 #define COPY_ARRAY(dst, src, n) copy_array((dst), (src), (n), sizeof(*(dst)) + \
index 75a08b2683e76e6832475bc91e4d4f38b3d3bc3c..b97ffdc9dd550d8802039d672623f2ba3e7a5f0c 100755 (executable)
@@ -337,6 +337,11 @@ do
                fix|strip)
                        force_rebase=t
                        ;;
+               warn|nowarn|error|error-all)
+                       ;; # okay, known whitespace option
+               *)
+                       die "fatal: Invalid whitespace option: '${1#*=}'"
+                       ;;
                esac
                ;;
        --ignore-whitespace)
@@ -352,6 +357,9 @@ do
                git_am_opt="$git_am_opt $1"
                force_rebase=t
                ;;
+       -C*[!0-9]*)
+               die "fatal: switch \`C' expects a numerical value"
+               ;;
        -C*)
                git_am_opt="$git_am_opt $1"
                ;;
index feb6a6a05edba0772f4cfd8b4529bce9d3858751..dc869f26c2b753593a875f275d896933b7723b31 100644 (file)
@@ -412,7 +412,7 @@ static inline void oe_set_tree_depth(struct packing_data *pack,
                                     unsigned int tree_depth)
 {
        if (!pack->tree_depth)
-               ALLOC_ARRAY(pack->tree_depth, pack->nr_objects);
+               CALLOC_ARRAY(pack->tree_depth, pack->nr_alloc);
        pack->tree_depth[e - pack->objects] = tree_depth;
 }
 
@@ -429,7 +429,7 @@ static inline void oe_set_layer(struct packing_data *pack,
                                unsigned char layer)
 {
        if (!pack->layer)
-               ALLOC_ARRAY(pack->layer, pack->nr_objects);
+               CALLOC_ARRAY(pack->layer, pack->nr_alloc);
        pack->layer[e - pack->objects] = layer;
 }