Browse Source

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>
maint
Nguyễn Thái Ngọc Duy 18 years ago committed by Junio C Hamano
parent
commit
b87841e164
  1. 2
      builtin-write-tree.c

2
builtin-write-tree.c

@ -52,6 +52,8 @@ int write_tree(unsigned char *sha1, int missing_ok, const char *prefix) @@ -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…
Cancel
Save