From: Nikolai Hartmann <nikolai.hartmann@gmx.de>
To: git@vger.kernel.org
Subject: git subtree merge deletes files in top directory
Date: Sat, 13 May 2017 11:20:56 +0200 [thread overview]
Message-ID: <aa3f2a1c-42d2-06df-9823-c455c798ffb0@gmx.de> (raw)
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
reply other threads:[~2017-05-13 9:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aa3f2a1c-42d2-06df-9823-c455c798ffb0@gmx.de \
--to=nikolai.hartmann@gmx.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).