[PATCH] can't "svn patch" working copy root if the patch is in --git format
From: Dmitry Pavlenko <pavlenko_at_tmatesoft.com>
Date: Mon, 09 Jul 2018 17:10:26 +0200
Hello!
I've found a bug when applying a patch in Git format to the working copy root.
#!/bin/sh
SVN=svn
#1. Create an empty SVN repository.
REPOSITORY_PATH="$PWD/svn.repo"
svnadmin create "$REPOSITORY_PATH"
# 2. Create a patch that sets some property on a root directory. E.g.
WC_PATH="/tmp/wc"
$SVN co $REPOSITORY_URL $WC_PATH
$SVN diff --git $WC_PATH > $PATCH_PATH
# 3. Create another clean working copy for that repository
$SVN revert $WC_PATH
# 4. Apply the patch
$SVN patch $PATCH_PATH $WC_PATH
# 5. Check the property of $WC_PATH
ACTUAL_PROPERTY_VALUE=`svn propget svn:ignore $WC_PATH`
echo "===="
Note that the patch looks like
Index: /tmp/wc
Property changes on:
The problem happens in parse-diff.c in git_start() function when parsing
diff --git a/ b/
line in 2 places. The first one is:
if (! *(new_path_marker + 3))
We get inside the check as there's no continuation after "b/" and SVN thinks
Another place is:
/* No path after the marker. */
The logic is the same. When I comment out both check the code works correctly
* subversion/libsvn_diff/parse-diff.c
]]]
-- Dmitry Pavlenko, TMate Software, http://subgit.com/ - git-svn bridgeReceived on 2018-07-09 17:59:42 CEST |
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.