* git subtree merge deletes files in top directory
@ 2017-05-13 9:20 Nikolai Hartmann
0 siblings, 0 replies; only message in thread
From: Nikolai Hartmann @ 2017-05-13 9:20 UTC (permalink / raw)
To: git
Hi,
I'm trying to add a subtree which contains a folder with the same name
as the subtree directory itself.
Adding seems to work, but if i pull after the subtree remote changed,
files in my top directory are deleted and everything seems to have
"moved up" one directory - although i specify a subtree directory with "-P"
For example i start with top repository that contains one file:
.
└── topfile
Now i try to add another repository as a subtree which looks like this:
.
├── afile
└── subrep
└── anotherfile
Running `git subtree add -P subrep origin_subrep master --squash` on the
top repository produces correctly
.
├── subrep
│ ├── afile
│ └── subrep
│ └── anotherfile
└── topfile
Now i change the subrep git by just adding files
.
├── afile
├── bfile
└── subrep
├── anotherfile
└── yetanotherfile
When i try to merge these into the top repository by `git subtree pull
-P subrep origin_subrep master --squash` i get
[...]
Removing topfile
Removing subrep/subrep/anotherfile
Removing subrep/afile
Merge made by the 'recursive' strategy.
subrep/subrep/anotherfile => anotherfile | 0
subrep/afile | 0
topfile => yetanotherfile | 0
3 files changed, 0 insertions(+), 0 deletions(-)
rename subrep/subrep/anotherfile => anotherfile (100%)
delete mode 100644 subrep/afile
rename topfile => yetanotherfile (100%)
And my top repository looks like
.
├── anotherfile
└── yetanotherfile
The issue seems to be related to the subdirectory "subrep" of my
repository "surep" having the same name - if i rename it to something
else everything works as expected.
I could reproduce this behaviour in git 2.12.0 and the current next
branch (v2.13.0-303-g4ebf30216)
Thanks,
Nikolai
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-05-13 9:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-13 9:20 git subtree merge deletes files in top directory Nikolai Hartmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).