diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-03-10 01:26:23 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-03-10 01:26:23 -0700 |
commit | 542c264b01ac551dca0697d6577ec71ad4c245ab (patch) | |
tree | 0fe387cfcce0b0b8c6d2c37d25d6cfb715808d03 /unpack-trees.c | |
parent | 1caeacc1f2973cecf7919a141adc4759acae94d0 (diff) | |
download | git-542c264b01ac551dca0697d6577ec71ad4c245ab.tar.gz git-542c264b01ac551dca0697d6577ec71ad4c245ab.tar.xz |
traverse_trees_recursive(): propagate merge errors up
There were few places where merge errors detected deeper in the call chain
were ignored and not propagated up the callchain to the caller.
Most notably, this caused switching branches with "git checkout" to ignore
a path modified in a work tree are different between the HEAD version and
the commit being switched to, which it internally notices but ignores it,
resulting in an incorrect two-way merge and loss of the change in the work
tree.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r-- | unpack-trees.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/unpack-trees.c b/unpack-trees.c index da68557b1..5a0f0382b 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -144,8 +144,7 @@ int traverse_trees_recursive(int n, unsigned long dirmask, unsigned long df_conf sha1 = names[i].sha1; fill_tree_descriptor(t+i, sha1); } - traverse_trees(n, t, &newinfo); - return 0; + return traverse_trees(n, t, &newinfo); } /* @@ -306,7 +305,9 @@ static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, str if (src[0]) conflicts |= 1; } - traverse_trees_recursive(n, dirmask, conflicts, names, info); + if (traverse_trees_recursive(n, dirmask, conflicts, + names, info) < 0) + return -1; return mask; } |