From 6712ff48e8dcc89a3d8aee30f7f114322ed19ba9 Mon Sep 17 00:00:00 2001 From: Matt Shin Date: Tue, 21 Feb 2017 12:03:33 +0000 Subject: [PATCH] fcm switch: fix Perl warning This happened on an unexpected usage. A user has checked out an entire project tree, and then run `fcm switch trunk` on it. Clearly it did not work, but the added Perl warning was not helpful either. --- lib/FCM1/Cm.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/FCM1/Cm.pm b/lib/FCM1/Cm.pm index c8b5193e..0a1bd9aa 100644 --- a/lib/FCM1/Cm.pm +++ b/lib/FCM1/Cm.pm @@ -1794,7 +1794,9 @@ sub _cm_get_source { return _cm_err(FCM1::Cm::Exception->INVALID_BRANCH, $source_url); } $source->url_peg( - $source->branch_url() . '/' . $target->subdir() . '@' . $source->pegrev() + $source->branch_url() + . ($target->subdir() ? '/' . $target->subdir() : q{}) + . ('@' . $source->pegrev()) ); # Ensure that the source and target URLs are in the same project if ($source->project_url() ne $target->project_url()) {