Skip to content
  • brian m. carlson's avatar
    strbuf: convert strbuf_add_unique_abbrev to use struct object_id · 30e677e0
    brian m. carlson authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Convert the declaration and definition of strbuf_add_unique_abbrev to
    make it take a pointer to struct object_id.  Predeclare the struct in
    strbuf.h, as cache.h includes strbuf.h before it declares the struct,
    and otherwise the struct declaration would have the wrong scope.
    
    Apply the following semantic patch, along with the standard object_id
    transforms, to adjust the callers:
    
    @@
    expression E1, E2, E3;
    @@
    - strbuf_add_unique_abbrev(E1, E2.hash, E3);
    + strbuf_add_unique_abbrev(E1, &E2, E3);
    
    @@
    expression E1, E2, E3;
    @@
    - strbuf_add_unique_abbrev(E1, E2->hash, E3);
    + strbuf_add_unique_abbrev(E1, E2, E3);
    
    Signed-off-by: default avatarbrian m. carlson <sandals@crustytoothpaste.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    30e677e0