Skip to content

Commit

Permalink
git-svn: Cache results of running the executable "git config"
Browse files Browse the repository at this point in the history
Running programs is not cheap!

Signed-off-by: James Y Knight <jknight@itasoftware.com>
Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
  • Loading branch information
James Y Knight authored and Eric Wong committed Apr 9, 2011
1 parent 12a296b commit f5549af
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ sub _req_svn {
use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
use IPC::Open3;
use Git;
use Memoize; # core since 5.8.0, Jul 2002

BEGIN {
# import functions from Git into our packages, en masse
Expand All @@ -72,6 +73,8 @@ BEGIN
*{"${package}::$_"} = \&{"Git::$_"};
}
}
Memoize::memoize 'Git::config';
Memoize::memoize 'Git::config_bool';
}

my ($SVN);
Expand Down Expand Up @@ -3210,6 +3213,8 @@ sub has_no_changes {
Memoize::unmemoize 'check_cherry_pick';
Memoize::unmemoize 'has_no_changes';
}

Memoize::memoize 'Git::SVN::repos_root';
}

END {
Expand Down

0 comments on commit f5549af

Please sign in to comment.