Submodule handling broken when changing branches?

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

 



Good morning devs,

I'm wondering whether it is the intented behaviour that after
adding a submodule one is unable to change branchen?

Steps to reproduce

   ( mkdir sm && cd sm && touch a && git init && git add . && git commit -m "init" )

   ( mkdir -p project/smdir && cd project && touch smdir/a  && git init && git add . && git commit -m "init" && git branch second ) 

  ( cd project && git rm smdir/a &&  git commit -m "remove file that will be replaced by sm")
  
  ( cd project && git submodule add ~/temp/git/sm smdir && git submodule update --init && git commit -m "add submodule" )

  ( cd project && git checkout second )
  error: Untracked working tree file 'smdir/a' would be overwritten by merge.

It seems that the contents of a submodule are not cleanly moved away
when switching branches, I also see that in other places where the directory
is not known to the other branch, it will just stay.

If that is intented, what would be the clean way to switch the branch?
If so, shouldn't it be documented in the manpage?

Nico

-- 
New PGP key: 7ED9 F7D3 6B10 81D7 0EC5  5C09 D7DC C8E4 3187 7DF0
Please resign, if you signed 9885188C or 8D0E27A4.

Currently moving *.schottelius.org to http://www.nico.schottelius.org/ ...

Attachment: pgpuqrAoKq158.pgp
Description: PGP signature


[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]