summaryrefslogtreecommitdiffstats
path: root/Tools/Scripts/VCSUtils.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/Scripts/VCSUtils.pm')
-rw-r--r--Tools/Scripts/VCSUtils.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/Tools/Scripts/VCSUtils.pm b/Tools/Scripts/VCSUtils.pm
index 70e9acd..a05a75d 100644
--- a/Tools/Scripts/VCSUtils.pm
+++ b/Tools/Scripts/VCSUtils.pm
@@ -59,6 +59,7 @@ BEGIN {
&gitBranch
&gitdiff2svndiff
&isGit
+ &isGitSVN
&isGitBranchBuild
&isGitDirectory
&isSVN
@@ -88,6 +89,7 @@ our @EXPORT_OK;
my $gitBranch;
my $gitRoot;
my $isGit;
+my $isGitSVN;
my $isGitBranchBuild;
my $isSVN;
my $svnVersion;
@@ -201,6 +203,18 @@ sub isGit()
return $isGit;
}
+sub isGitSVN()
+{
+ return $isGitSVN if defined $isGitSVN;
+
+ # There doesn't seem to be an officially documented way to determine
+ # if you're in a git-svn checkout. The best suggestions seen so far
+ # all use something like the following:
+ my $output = `git config --get svn-remote.svn.fetch 2>& 1`;
+ $isGitSVN = $output ne '';
+ return $isGitSVN;
+}
+
sub gitBranch()
{
unless (defined $gitBranch) {