зеркало из https://github.com/microsoft/git.git
for-each-ref: fix objectname:short bug
When objectname:short was introduced, it forgot to copy the result of find_unique_abbrev. Because the result of find_unique_abbrev is a pointer to static buffer, this resulted in the same value being substituted in for each ref. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
2244eab01b
Коммит
ea16a030aa
|
@ -228,7 +228,8 @@ static void grab_common_values(struct atom_value *val, int deref, struct object
|
|||
v->s = s;
|
||||
}
|
||||
else if (!strcmp(name, "objectname:short")) {
|
||||
v->s = find_unique_abbrev(obj->sha1, DEFAULT_ABBREV);
|
||||
v->s = xstrdup(find_unique_abbrev(obj->sha1,
|
||||
DEFAULT_ABBREV));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче