[FYI/PATCH 4/5] Git::SVN::_new: use accessor to write path field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michael G. Schwern <schwern@xxxxxxxxx>
Date: Fri, 27 Jul 2012 13:00:48 -0700

If some day the setter is taught to canonicalize paths, make sure the
path gets canonicalized at construction time, too.

[jn: split from a larger patch]

Signed-off-by: Eric Wong <normalperson@xxxxxxxx>
Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
---
 perl/Git/SVN.pm |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
index 826a7fa6..3aa20109 100644
--- a/perl/Git/SVN.pm
+++ b/perl/Git/SVN.pm
@@ -2280,10 +2280,12 @@ sub _new {
 
 	$_[3] = $path = '' unless (defined $path);
 	mkpath([$dir]);
-	bless {
+	my $obj = bless {
 		ref_id => $ref_id, dir => $dir, index => "$dir/index",
-	        path => $path, config => "$ENV{GIT_DIR}/svn/config",
+	        config => "$ENV{GIT_DIR}/svn/config",
 	        map_root => "$dir/.rev_map", repo_id => $repo_id }, $class;
+	$obj->path($path);
+	return $obj;
 }
 
 sub path {
-- 
1.7.10.4

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


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]