git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH/RFC] git-svn: use path accessor for Git::SVN objects

From
EWEric Wong <normalperson@yhbt.net>
Date
Sep 18, 2012, 00:09 UTC
Message-ID
<20120918000931.GB17939@dcvr.yhbt.net>

The accessors should improve maintainability and enforce consistent access to Git::SVN objects.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
  (RFC since I could've missed something)
  Eric Wong <normalperson@yhbt.net> wrote:
  > I'll apply the following (on top of a patch which fixes some
  > {path} usages):
 git-svn.perl       | 2 +-
 perl/Git/SVN/Ra.pm | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 0d77ffb..bd5266c 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1314,7 +1314,7 @@ sub get_svnprops {
 	$path = $cmd_dir_prefix . $path;
 	fatal("No such file or directory: $path") unless -e $path;
 	my $is_dir = -d $path ? 1 : 0;
-	$path = join_paths($gs->{path}, $path);
+	$path = join_paths($gs->path, $path);
 
 	# canonicalize the path (otherwise libsvn will abort or fail to
 	# find the file)
diff --git a/perl/Git/SVN/Ra.pm b/perl/Git/SVN/Ra.pm
index 90ec30b..049c97b 100644
--- a/perl/Git/SVN/Ra.pm
+++ b/perl/Git/SVN/Ra.pm
@@ -416,7 +416,7 @@ sub gs_fetch_loop_common {
 		}
 		$SVN::Error::handler = $err_handler;
 
-		my %exists = map { $_->{path} => $_ } @$gsv;
+		my %exists = map { $_->path => $_ } @$gsv;
 		foreach my $r (sort {$a <=> $b} keys %revs) {
 			my ($paths, $logged) = @{$revs{$r}};
 
-- 
1.7.12.441.g0590587.dirty
Next: Jonathan Nieder
Message 1 of 3 in “git-svn: use path accessor for Git::SVN objects”
  1. git-svn: use path accessor for Git::SVN objectsEric Wong, Sep 18, 2012
  2. Jonathan NiederSep 18, 2012
  3. Junio C HamanoSep 18, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.