summaryrefslogtreecommitdiff
path: root/builtin/for-each-ref.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/for-each-ref.c')
-rw-r--r--builtin/for-each-ref.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
index 7f5011f..89e75c6 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));
+ }
}
}