[Bps-public-commit] Config-GitLike branch, master, updated. 1.07-1-g5f4a8c8
Alex Vandiver
alexmv at bestpractical.com
Wed Feb 15 23:15:57 EST 2012
The branch, master has been updated
discards eaac3d652dc9544390b891a426092d165576acd7 (commit)
via 5f4a8c8ceb620f4cbcd690cfc60b29c6dbd5a67c (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (eaac3d652dc9544390b891a426092d165576acd7)
\
N -- N -- N (5f4a8c8ceb620f4cbcd690cfc60b29c6dbd5a67c)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
Summary of changes:
- Log -----------------------------------------------------------------
commit 5f4a8c8ceb620f4cbcd690cfc60b29c6dbd5a67c
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed Feb 15 21:50:56 2012 -0500
Fix loading of user_file, broken in dcdd01f, due to unexpanded ~
dcdd01f broke loading of ->user_file, by moving ~ expansion into
->load_file -- but ->load_user checked the file-ness of the raw value of
->user_file, which included the literal ~. This means that user files
were generally only loaded because the target directory was beneath the
user's home directory -- and Config::GitLike::Git _never_ loaded the
user's ~/.gitconfig !
Instead of having ->load_user and ->load_global check the validity of
their arguments explicitly, rely on ->load_file's ability to tolerate
being called on non-existant files. Push the previous -f check down
into ->_read_config to handle odd corner cases, such as the filename
being to a directory, which open() tolerates on some systems.
Reported-by: Chia-liang Kao <clkao at clkao.org>
diff --git a/lib/Config/GitLike.pm b/lib/Config/GitLike.pm
index 6ba0d51..bdbaf87 100644
--- a/lib/Config/GitLike.pm
+++ b/lib/Config/GitLike.pm
@@ -114,7 +114,6 @@ sub global_file {
sub load_global {
my $self = shift;
- return unless -f $self->global_file;
return $self->load_file( $self->global_file );
}
@@ -126,7 +125,6 @@ sub user_file {
sub load_user {
my $self = shift;
- return unless -f $self->user_file;
return $self->load_file( $self->user_file );
}
@@ -135,6 +133,7 @@ sub _read_config {
my $self = shift;
my $filename = shift;
+ return unless -f $filename and -r $filename;
open(my $fh, '<', $filename) or return;
my $c = do {local $/; <$fh>};
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list