One common use-case for git subtree is to use it only on taged commits from the remote project. however the current implementation of gi-subtree can not be used in that way. two orthogonal prevent this
the SHA used as the origin revision can be the SHA of a tag which isn't available locally. This works correctly at merge time but will fail at split time. The first patch uses the ^{} notation to make sure a correct commit SHA is used instead of the SHA given as a parameterthe checks for the correctness of the target ref to pull or add checks that the name matches a local ref (which is incorrect). The second patch use ls-remote to validate the ref name given against the ones in the remote repository
Jérémy Rosen (2):
git-subtree: make sure the SHA saved as ancestor is a commit
git-subtree: use ls-remote to check the refspec passed to pull and
add contrib/subtree/git-subtree.sh | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)