X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin%2Ffor-each-ref.c;h=89e75c6894e6fdb2abbe464d825f5c7186a14141;hb=e917918335e660629007f3d2d07d3d9a019b5273;hp=7f5011f75ef9eb549b33861d9546f3d18a94c256;hpb=6f79d6689193dad107b9424e9bd699d20c7d5c33;p=git.git diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c index 7f5011f75..89e75c689 100644 --- a/builtin/for-each-ref.c +++ b/builtin/for-each-ref.c @@ -227,6 +227,10 @@ static void grab_common_values(struct atom_value *val, int deref, struct object strcpy(s, sha1_to_hex(obj->sha1)); v->s = s; } + else if (!strcmp(name, "objectname:short")) { + v->s = xstrdup(find_unique_abbrev(obj->sha1, + DEFAULT_ABBREV)); + } } }