Re: [BUG] Silent data loss on merge with uncommited changes + renames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Sixt <j.sixt@xxxxxxxxxxxxx> writes:

> Am 4/22/2013 11:24, schrieb Matthieu Moy:
>> Following the discussion on "merge with uncommited changes" inside the
>> "git pull --autostash" thread, I did a bit of testing, and encountered a
>> case with silent data loss. In short: merge a branch introducing changes
>> to a file. If the file has been renamed in the current branch, then "git
>> merge" follows the rename and brings changes to the renamed file, but
>> uncommited changes in this file are overriden silently.
>
> Can you check whether your case is already covered by one of:
>
>   git grep expect_failure t/*merge*

Indeed, it's already here:

test_expect_failure 'will not overwrite unstaged changes in renamed file' '
	git reset --hard c1 &&
	git mv c1.c other.c &&
	git commit -m rename &&
	cp important other.c &&
	git merge c1a &&
	test_cmp important other.c
'

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]