In this commit:
https://github.com/git/git/commit/10a49587fabde88c0afbc80a99d97fae91811f5f

git subtree add for a remote repository and branch was fundamentally broken.

It works by chance if a local branch exists that matches the name of
the desired remote branch.  Thus, "master" happens to work and the bug
possibly escapes common notice.

cmd_add_repository() does a git fetch - the desired remote refspec can
never be found in the local repo until that git fetch is run, so the
attempt to validate it within cmd_add() is wrong - if desired, that
should happen after the fetch in cmd_add_repository().

I think the additions shown in lines 505 and 506 should be reverted,
since the rev is also checked in cmd_add_commit()

Best,

Peter Wolanin
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to