Fix many regressions with git-svn and add missing unit tests.
Review Request #12652 — Created Sept. 28, 2022 and submitted
git-svnsupport hasn't worked out of the box in many years,
which shows how rarely people are using it anymore. The work formerly
done to add smart remote and ancestor branch detection failed if
explicit parents and tracking branches weren't provided.
The reason is that a
git-svnremote is fake. There's a reference, and
it's in the
.git/configfile, but it doesn't exist as a proper remote.
Because of this, all remote-related checks failed.
On top of that, diff building failed due to Python string issues and
just some bad logic that didn't catch many operations.
This change fixes all that. We now handle the fake
attempting to determine remotes and tracking branches.
Our ancestor detection no longer breaks when the common ancestor is the
first commit in the repository (which can occur for new repositories
Diff building now uses the proper string types, and brings some fixes
over from the recent
git-p4diff building fixes to ensure proper diffs
when there are spaces in filenames or files are deleted.
Renames/moves/copies don't work, but there's a lot wrong with this in
Subversion diffs anyway.
Unit tests pass.
Manually tested with a fresh new local git-svn clone. Verified I was
able to generate working diffs from added, deleted, and edited changes