git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Merge with local conflicts in new files

From
SSanti <sbejar@gmail.com>
Date
May 16, 2006, 22:00 UTC
Message-ID
<8aa486160605161500m1dd8428cj@mail.gmail.com>
Hi *,
       In the case of:
- You merge from a branch with new files
- You have these files in the working directory
- You do not have these files in the HEAD.
   The end result is that you lose the content of these files.
   So an additional check for the merge is to check for these dirty
but not in HEAD files.
   Here is a test that reproduce it. I expect the merge to fail and
with the content of foo being bar.

test_description='Test merge with local conflicts in new files' . ./test-lib.sh

test_expect_success 'prepare repository' \ 'echo "Hello" > init && git add init && git commit -m "Initial commit" && git branch B && echo "foo" > foo && git add foo && git commit -m "File: foo" && git checkout B && echo "bar" > foo '

test_expect_code 1 'Merge with local conflicts in new files' 'git merge "merge msg" B master'

test_done
Thanks.
Next: Santi
Message 1 of 10 in “Merge with local conflicts in new files”
  1. SantiMay 16, 2006
  2. SantiMay 16, 2006
  3. Junio C HamanoMay 16, 2006
  4. SantiMay 16, 2006
  5. Junio C HamanoMay 16, 2006
  6. Pavel RoskinMay 17, 2006
  7. Junio C HamanoMay 17, 2006
  8. Martin LanghoffMay 17, 2006
  9. read-tree -m -u: do not overwrite or remove untracked working tree files.Junio C Hamano, May 17, 2006
  10. Jakub NarebskiMay 17, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.