summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7549376)
raw | patch | inline | side by side (parent: 7549376)
author | Steffen Prohaska <prohaska@zib.de> | |
Sat, 26 Jan 2008 09:54:06 +0000 (10:54 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 27 Jan 2008 01:58:18 +0000 (17:58 -0800) |
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>
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>
git-cvsserver.perl | patch | blob | history | |
t/t9400-git-cvsserver-server.sh | patch | blob | history |
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index ecded3b9cba9e18117f7372af37e9b56203a6fcf..afe3d0b7fe4d643688e672f62844cc86ec64fab5 100755 (executable)
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
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;
index 1f2749eefba9baa4b3b88bac3ff8f2d9525896a2..75d1ce433d3110e6fe24be00aef8dcc7592d8082 100755 (executable)
echo >empty &&
git add empty &&
git commit -q -m "First Commit" &&
+ mkdir secondroot &&
+ ( cd secondroot &&
+ git init &&
+ touch secondrootfile &&
+ git add secondrootfile &&
+ git commit -m "second root") &&
+ git pull secondroot master &&
git clone -q --local --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log"
# as argument to co -d
test_expect_success 'basic checkout' \
'GIT_CONFIG="$git_config" cvs -Q co -d cvswork master &&
- test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5))" = "empty/1.1/"'
+ test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))" = "empty/1.1/"
+ test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | tail -n 1))" = "secondrootfile/1.1/"'
#------------------------
# PSERVER AUTHENTICATION