author | Junio C Hamano <junkio@cox.net> | |
Fri, 23 Sep 2005 07:43:04 +0000 (00:43 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 27 Sep 2005 01:04:17 +0000 (18:04 -0700) | ||
commit | a935824036dc2c5a8ef1980a4b05a12228712754 | |
tree | 22d7522cc0361d43f4a594eaeb6a557e2b2d9164 | tree | snapshot |
parent | 036a72d8fa25d9c56c19ae4c761401a58c43b8f6 | commit | diff |
Fix overzealous cleanliness check in git-merge
Being able to try multiple strategies and automatically picking one
that seems to give less conflicting result may or may not much sense
in practice. At least that should not force normal use case to
additionally require the working tree to be fully clean. As Linus
shouted, local changes do not matter unless they interfere with the
merge.
This commit changes git-merge not to require a clean working tree.
Only when we will iterate through more than one merge strategies,
local changes are stashed away before trying the first merge, and
restored before second and later merges are attempted.
The index file must be in sync with HEAD in any case -- otherwise the
merge result would contain changes since HEAD that was done locally
and registered in the index. This check is already enforced by
three-way read-tree existing merge strategies use, but is done here as
a safeguard as well.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Being able to try multiple strategies and automatically picking one
that seems to give less conflicting result may or may not much sense
in practice. At least that should not force normal use case to
additionally require the working tree to be fully clean. As Linus
shouted, local changes do not matter unless they interfere with the
merge.
This commit changes git-merge not to require a clean working tree.
Only when we will iterate through more than one merge strategies,
local changes are stashed away before trying the first merge, and
restored before second and later merges are attempted.
The index file must be in sync with HEAD in any case -- otherwise the
merge result would contain changes since HEAD that was done locally
and registered in the index. This check is already enforced by
three-way read-tree existing merge strategies use, but is done here as
a safeguard as well.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-merge.sh | diff | blob | history |