[BUG] Amending a shallow clone -> orphan branch
- From
- Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
- Date
- Aug 6, 2021, 00:04 UTC
- Message-ID
- <64760969-1ead-2bfb-6f98-1161d385c0ca@syntevo.com>
Consider the following steps :
git clone --depth 1 --single-branch --branch master https://github.com/git/git cd git >1.txt git add 1.txt git commit --amend
This results in an orphaned branch, where a single commit contains entire tree.
I understand that this is a bug, because certainly git knew shallow commit's parents and could reuse that when amending?