Skip to content

Commit 7507a46

Browse files
committed
Merge pull request jwiegley#23 from javabrett/git-svn-diff-prefix-support
Added support for non-empty git-svn prefix
2 parents bf7cc1a + fc48ce9 commit 7507a46

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: git-svn-diff

+9
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
# <javabrett>
2626
# - Retain space after leading --- and +++, add TAB before (revision 0)
2727
# - Use \t instead of spaces before (revision $REV) and (working copy)
28+
#
29+
# <javabrett>
30+
# - Added support for non-empty git-svn prefix, important now that the
31+
# - default --prefix is "origin/" in Git 2.0+.
2832

2933
# Get the tracking branch (if we're on a branch)
3034

@@ -39,6 +43,11 @@ case "$TRACKING_BRANCH" in
3943
TRACKING_BRANCH=$(git config --get svn-remote.svn.fetch |
4044
sed -e 's,.*:refs/remotes/,,')
4145
;;
46+
*)
47+
# GIT_SVN_PREFIX will be origin/ by-default in Git 2.0 or later, or ""
48+
GIT_SVN_PREFIX=$(git config --get svn-remote.svn.branches | sed -e 's,.*:refs/remotes/\(.*\)\*$,\1,')
49+
TRACKING_BRANCH=${GIT_SVN_PREFIX}${TRACKING_BRANCH}
50+
;;
4251
esac
4352

4453
# Get the highest revision number

0 commit comments

Comments
 (0)