mirror of
https://github.com/git/git.git
synced 2024-11-18 17:13:55 +01:00
git-write-tree should not crash if prefix does not exist
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
e7a7be8831
commit
b87841e164
@ -52,6 +52,8 @@ int write_tree(unsigned char *sha1, int missing_ok, const char *prefix)
|
||||
if (prefix) {
|
||||
struct cache_tree *subtree =
|
||||
cache_tree_find(active_cache_tree, prefix);
|
||||
if (!subtree)
|
||||
die("git-write-tree: prefix %s not found", prefix);
|
||||
hashcpy(sha1, subtree->sha1);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user