Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteffen Prohaska <prohaska@zib.de>2008-01-26 12:54:06 +0300
committerJunio C Hamano <gitster@pobox.com>2008-01-27 04:58:18 +0300
commite509db990b2ecae642efe3cdef4014d57d525f24 (patch)
treeb2c8ce5e08372d7645e24a0a2cb38e55520ed5c8 /git-cvsserver.perl
parent7549376587ba5ffea973663f72804072d8f1d5dd (diff)
cvsserver: Fix for histories with multiple roots
Git histories may have multiple roots, which can cause git merge-base to fail and this caused git cvsserver to die. This commit teaches git cvsserver to handle a failing git merge-base gracefully, and modifies the test case to verify this. All the test cases now use a history with two roots. Signed-off-by: Steffen Prohaska <prohaska@zib.de> git-cvsserver.perl | 9 ++++++++- t/t9400-git-cvsserver-server.sh | 10 +++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-cvsserver.perl')
-rwxr-xr-xgit-cvsserver.perl9
1 files changed, 8 insertions, 1 deletions
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index ecded3b9cb..afe3d0b7fe 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -2543,8 +2543,15 @@ sub update
if ($parent eq $lastpicked) {
next;
}
- my $base = safe_pipe_capture('git-merge-base',
+ my $base = eval {
+ safe_pipe_capture('git-merge-base',
$lastpicked, $parent);
+ };
+ # The two branches may not be related at all,
+ # in which case merge base simply fails to find
+ # any, but that's Ok.
+ next if ($@);
+
chomp $base;
if ($base) {
my @merged;