Skip to content

Commit cc756ed

Browse files
committed
unpack-trees: let merged_entry() pass through do_add_entry()'s errors
A `git clone` will end with exit code 0 when `merged_entry()` returns a positive value during a call of `unpack_trees()` to `traverse_trees()`. The reason is that `unpack_trees()` will interpret a positive value not to be an error. The problem is, however, that `add_index_entry()` (which is called by `merged_entry()` can report an error, and we really should fail the entire clone in such a case. Let's fix this problem, in preparation for a Windows-specific patch disallowing `mkdir()` with directory names that contain a trailing space (which is illegal on NTFS): we want `git clone` to abort when a path cannot be checked out due to that condition. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 35edce2 commit cc756ed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

unpack-trees.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,8 @@ static int merged_entry(const struct cache_entry *ce,
18211821
invalidate_ce_path(old, o);
18221822
}
18231823

1824-
do_add_entry(o, merge, update, CE_STAGEMASK);
1824+
if (do_add_entry(o, merge, update, CE_STAGEMASK) < 0)
1825+
return -1;
18251826
return 1;
18261827
}
18271828

0 commit comments

Comments
 (0)