{"thread":{"id":"38330","subject":"[PATCH] Git::SVN: handle missing ref_id case correctly","startedAt":"2015-01-10T14:35:10Z","lastAt":"2015-01-10T22:18:26Z","messageCount":5,"participants":["Ramkumar Ramachandra","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"254530","messageId":"1420900510-78522-1-git-send-email-artagnon@gmail.com","threadId":"38330","inReplyTo":null,"subject":"[PATCH] Git::SVN: handle missing ref_id case correctly","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2015-01-10T14:35:10Z","receivedAt":"2015-01-10T14:35:10Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"$ENV{GIT_SVN_ID} will return a string, so check it with defined. Also,\nref_id should not match \"refs/remotes/\".\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n perl/Git/SVN.pm | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm\nindex d9a52a5..06ff216 100644\n--- a/perl/Git/SVN.pm\n+++ b/perl/Git/SVN.pm\n@@ -40,7 +40,7 @@ BEGIN {\n our $_follow_parent  = 1;\n our $_minimize_url   = 'unset';\n our $default_repo_id = 'svn';\n-our $default_ref_id  = $ENV{GIT_SVN_ID} || 'git-svn';\n+our $default_ref_id  = defined $ENV{GIT_SVN_ID} ? $ENV{GIT_SVN_ID} : 'git-svn';\n \n my ($_gc_nr, $_gc_period);\n \n@@ -2365,7 +2365,7 @@ sub _new {\n \n \t# Older repos imported by us used $GIT_DIR/svn/foo instead of\n \t# $GIT_DIR/svn/refs/remotes/foo when tracking refs/remotes/foo\n-\tif ($ref_id =~ m{^refs/remotes/(.*)}) {\n+\tif ($ref_id =~ m{^refs/remotes/(.+)}) {\n \t\tmy $old_dir = \"$ENV{GIT_DIR}/svn/$1\";\n \t\tif (-d $old_dir && ! -d $dir) {\n \t\t\t$dir = $old_dir;\n-- \n2.2.1\n"},{"id":"254532","messageId":"CALkWK0=jEh06hZSmHim54BaP_KiC8hg-455STQphu17PSoQTqw@mail.gmail.com","threadId":"38330","inReplyTo":"1420900510-78522-1-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH] Git::SVN: handle missing ref_id case correctly","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2015-01-10T15:12:23Z","receivedAt":"2015-01-10T15:12:23Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Ramkumar Ramachandra wrote:\n> -our $default_ref_id  = $ENV{GIT_SVN_ID} || 'git-svn';\n> +our $default_ref_id  = defined $ENV{GIT_SVN_ID} ? $ENV{GIT_SVN_ID} : 'git-svn';\n\nThis is probably not a functional change; please look at the second hunk.\n"},{"id":"254542","messageId":"20150110221308.GA32253@dcvr.yhbt.net","threadId":"38330","inReplyTo":"CALkWK0=jEh06hZSmHim54BaP_KiC8hg-455STQphu17PSoQTqw@mail.gmail.com","subject":"Re: [PATCH] Git::SVN: handle missing ref_id case correctly","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2015-01-10T22:13:08Z","receivedAt":"2015-01-10T22:13:08Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Ramkumar Ramachandra <artagnon@gmail.com> wrote:\n> Ramkumar Ramachandra wrote:\n> > -our $default_ref_id  = $ENV{GIT_SVN_ID} || 'git-svn';\n> > +our $default_ref_id  = defined $ENV{GIT_SVN_ID} ? $ENV{GIT_SVN_ID} : 'git-svn';\n> \n> This is probably not a functional change; please look at the second hunk.\n\nIt is functional, maybe someone will use GIT_SVN_ID=0 ?\n"},{"id":"254544","messageId":"CALkWK0mXx5qQSNSC4ju8Bejy_XhewxDA+nwy1JCmodX3t-H+3A@mail.gmail.com","threadId":"38330","inReplyTo":"20150110221308.GA32253@dcvr.yhbt.net","subject":"Re: [PATCH] Git::SVN: handle missing ref_id case correctly","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2015-01-10T22:14:34Z","receivedAt":"2015-01-10T22:14:34Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Eric Wong wrote:\n> It is functional, maybe someone will use GIT_SVN_ID=0 ?\n\nRight. Kindly drop the first hunk.\n"},{"id":"254545","messageId":"CALkWK0mQCe_gUZCCnoZyNPCp=cubQcPAOSqAN0pzMA5eyYUdAQ@mail.gmail.com","threadId":"38330","inReplyTo":"CALkWK0mXx5qQSNSC4ju8Bejy_XhewxDA+nwy1JCmodX3t-H+3A@mail.gmail.com","subject":"Re: [PATCH] Git::SVN: handle missing ref_id case correctly","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2015-01-10T22:18:26Z","receivedAt":"2015-01-10T22:18:26Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Ramkumar Ramachandra wrote:\n>> It is functional, maybe someone will use GIT_SVN_ID=0 ?\n>\n> Right. Kindly drop the first hunk.\n\nAmendment: there are actually many other places where variables are\nchecked without \"defined\", so I doubt we want to put up with the extra\nugliness to allow \"0\".\n"}]}