t / t9500-gitweb-standalone-no-errors.shon commit Merge branch 'kb/tracking-count-no-merges' (988d9fd)
   1#!/bin/sh
   2#
   3# Copyright (c) 2007 Jakub Narebski
   4#
   5
   6test_description='gitweb as standalone script (basic tests).
   7
   8This test runs gitweb (git web interface) as CGI script from
   9commandline, and checks that it would not write any errors
  10or warnings to log.'
  11
  12gitweb_init () {
  13        safe_pwd="$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')"
  14        cat >gitweb_config.perl <<EOF
  15#!/usr/bin/perl
  16
  17# gitweb configuration for tests
  18
  19our \$version = "current";
  20our \$GIT = "git";
  21our \$projectroot = "$safe_pwd";
  22our \$project_maxdepth = 8;
  23our \$home_link_str = "projects";
  24our \$site_name = "[localhost]";
  25our \$site_header = "";
  26our \$site_footer = "";
  27our \$home_text = "indextext.html";
  28our @stylesheets = ("file:///$TEST_DIRECTORY/../gitweb/gitweb.css");
  29our \$logo = "file:///$TEST_DIRECTORY/../gitweb/git-logo.png";
  30our \$favicon = "file:///$TEST_DIRECTORY/../gitweb/git-favicon.png";
  31our \$projects_list = "";
  32our \$export_ok = "";
  33our \$strict_export = "";
  34
  35EOF
  36
  37        cat >.git/description <<EOF
  38$0 test repository
  39EOF
  40}
  41
  42gitweb_run () {
  43        GATEWAY_INTERFACE="CGI/1.1"
  44        HTTP_ACCEPT="*/*"
  45        REQUEST_METHOD="GET"
  46        SCRIPT_NAME="$TEST_DIRECTORY/../gitweb/gitweb.perl"
  47        QUERY_STRING=""$1""
  48        PATH_INFO=""$2""
  49        export GATEWAY_INTERFACE HTTP_ACCEPT REQUEST_METHOD \
  50                SCRIPT_NAME QUERY_STRING PATH_INFO
  51
  52        GITWEB_CONFIG=$(pwd)/gitweb_config.perl
  53        export GITWEB_CONFIG
  54
  55        # some of git commands write to STDERR on error, but this is not
  56        # written to web server logs, so we are not interested in that:
  57        # we are interested only in properly formatted errors/warnings
  58        rm -f gitweb.log &&
  59        perl -- "$SCRIPT_NAME" \
  60                >/dev/null 2>gitweb.log &&
  61        if grep "^[[]" gitweb.log >/dev/null 2>&1; then false; else true; fi
  62
  63        # gitweb.log is left for debugging
  64}
  65
  66. ./test-lib.sh
  67
  68perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || {
  69    say 'skipping gitweb tests, perl version is too old'
  70    test_done
  71    exit
  72}
  73
  74gitweb_init
  75
  76# ----------------------------------------------------------------------
  77# no commits (empty, just initialized repository)
  78
  79test_expect_success \
  80        'no commits: projects_list (implicit)' \
  81        'gitweb_run'
  82test_debug 'cat gitweb.log'
  83
  84test_expect_success \
  85        'no commits: projects_index' \
  86        'gitweb_run "a=project_index"'
  87test_debug 'cat gitweb.log'
  88
  89test_expect_success \
  90        'no commits: .git summary (implicit)' \
  91        'gitweb_run "p=.git"'
  92test_debug 'cat gitweb.log'
  93
  94test_expect_success \
  95        'no commits: .git commit (implicit HEAD)' \
  96        'gitweb_run "p=.git;a=commit"'
  97test_debug 'cat gitweb.log'
  98
  99test_expect_success \
 100        'no commits: .git commitdiff (implicit HEAD)' \
 101        'gitweb_run "p=.git;a=commitdiff"'
 102test_debug 'cat gitweb.log'
 103
 104test_expect_success \
 105        'no commits: .git tree (implicit HEAD)' \
 106        'gitweb_run "p=.git;a=tree"'
 107test_debug 'cat gitweb.log'
 108
 109test_expect_success \
 110        'no commits: .git heads' \
 111        'gitweb_run "p=.git;a=heads"'
 112test_debug 'cat gitweb.log'
 113
 114test_expect_success \
 115        'no commits: .git tags' \
 116        'gitweb_run "p=.git;a=tags"'
 117test_debug 'cat gitweb.log'
 118
 119
 120# ----------------------------------------------------------------------
 121# initial commit
 122
 123test_expect_success \
 124        'Make initial commit' \
 125        'echo "Not an empty file." > file &&
 126         git add file &&
 127         git commit -a -m "Initial commit." &&
 128         git branch b'
 129
 130test_expect_success \
 131        'projects_list (implicit)' \
 132        'gitweb_run'
 133test_debug 'cat gitweb.log'
 134
 135test_expect_success \
 136        'projects_index' \
 137        'gitweb_run "a=project_index"'
 138test_debug 'cat gitweb.log'
 139
 140test_expect_success \
 141        '.git summary (implicit)' \
 142        'gitweb_run "p=.git"'
 143test_debug 'cat gitweb.log'
 144
 145test_expect_success \
 146        '.git commit (implicit HEAD)' \
 147        'gitweb_run "p=.git;a=commit"'
 148test_debug 'cat gitweb.log'
 149
 150test_expect_success \
 151        '.git commitdiff (implicit HEAD, root commit)' \
 152        'gitweb_run "p=.git;a=commitdiff"'
 153test_debug 'cat gitweb.log'
 154
 155test_expect_success \
 156        '.git commitdiff_plain (implicit HEAD, root commit)' \
 157        'gitweb_run "p=.git;a=commitdiff_plain"'
 158test_debug 'cat gitweb.log'
 159
 160test_expect_success \
 161        '.git commit (HEAD)' \
 162        'gitweb_run "p=.git;a=commit;h=HEAD"'
 163test_debug 'cat gitweb.log'
 164
 165test_expect_success \
 166        '.git tree (implicit HEAD)' \
 167        'gitweb_run "p=.git;a=tree"'
 168test_debug 'cat gitweb.log'
 169
 170test_expect_success \
 171        '.git blob (file)' \
 172        'gitweb_run "p=.git;a=blob;f=file"'
 173test_debug 'cat gitweb.log'
 174
 175test_expect_success \
 176        '.git blob_plain (file)' \
 177        'gitweb_run "p=.git;a=blob_plain;f=file"'
 178test_debug 'cat gitweb.log'
 179
 180# ----------------------------------------------------------------------
 181# nonexistent objects
 182
 183test_expect_success \
 184        '.git commit (non-existent)' \
 185        'gitweb_run "p=.git;a=commit;h=non-existent"'
 186test_debug 'cat gitweb.log'
 187
 188test_expect_success \
 189        '.git commitdiff (non-existent)' \
 190        'gitweb_run "p=.git;a=commitdiff;h=non-existent"'
 191test_debug 'cat gitweb.log'
 192
 193test_expect_success \
 194        '.git commitdiff (non-existent vs HEAD)' \
 195        'gitweb_run "p=.git;a=commitdiff;hp=non-existent;h=HEAD"'
 196test_debug 'cat gitweb.log'
 197
 198test_expect_success \
 199        '.git tree (0000000000000000000000000000000000000000)' \
 200        'gitweb_run "p=.git;a=tree;h=0000000000000000000000000000000000000000"'
 201test_debug 'cat gitweb.log'
 202
 203test_expect_success \
 204        '.git tag (0000000000000000000000000000000000000000)' \
 205        'gitweb_run "p=.git;a=tag;h=0000000000000000000000000000000000000000"'
 206test_debug 'cat gitweb.log'
 207
 208test_expect_success \
 209        '.git blob (non-existent)' \
 210        'gitweb_run "p=.git;a=blob;f=non-existent"'
 211test_debug 'cat gitweb.log'
 212
 213test_expect_success \
 214        '.git blob_plain (non-existent)' \
 215        'gitweb_run "p=.git;a=blob_plain;f=non-existent"'
 216test_debug 'cat gitweb.log'
 217
 218
 219# ----------------------------------------------------------------------
 220# commitdiff testing (implicit, one implicit tree-ish)
 221
 222test_expect_success \
 223        'commitdiff(0): root' \
 224        'gitweb_run "p=.git;a=commitdiff"'
 225test_debug 'cat gitweb.log'
 226
 227test_expect_success \
 228        'commitdiff(0): file added' \
 229        'echo "New file" > new_file &&
 230         git add new_file &&
 231         git commit -a -m "File added." &&
 232         gitweb_run "p=.git;a=commitdiff"'
 233test_debug 'cat gitweb.log'
 234
 235test_expect_success \
 236        'commitdiff(0): mode change' \
 237        'test_chmod +x new_file &&
 238         git commit -a -m "Mode changed." &&
 239         gitweb_run "p=.git;a=commitdiff"'
 240test_debug 'cat gitweb.log'
 241
 242test_expect_success \
 243        'commitdiff(0): file renamed' \
 244        'git mv new_file renamed_file &&
 245         git commit -a -m "File renamed." &&
 246         gitweb_run "p=.git;a=commitdiff"'
 247test_debug 'cat gitweb.log'
 248
 249test_expect_success SYMLINKS \
 250        'commitdiff(0): file to symlink' \
 251        'rm renamed_file &&
 252         ln -s file renamed_file &&
 253         git commit -a -m "File to symlink." &&
 254         gitweb_run "p=.git;a=commitdiff"'
 255test_debug 'cat gitweb.log'
 256
 257test_expect_success \
 258        'commitdiff(0): file deleted' \
 259        'git rm renamed_file &&
 260         rm -f renamed_file &&
 261         git commit -a -m "File removed." &&
 262         gitweb_run "p=.git;a=commitdiff"'
 263test_debug 'cat gitweb.log'
 264
 265test_expect_success \
 266        'commitdiff(0): file copied / new file' \
 267        'cp file file2 &&
 268         git add file2 &&
 269         git commit -a -m "File copied." &&
 270         gitweb_run "p=.git;a=commitdiff"'
 271test_debug 'cat gitweb.log'
 272
 273test_expect_success \
 274        'commitdiff(0): mode change and modified' \
 275        'echo "New line" >> file2 &&
 276         test_chmod +x file2 &&
 277         git commit -a -m "Mode change and modification." &&
 278         gitweb_run "p=.git;a=commitdiff"'
 279test_debug 'cat gitweb.log'
 280
 281test_expect_success \
 282        'commitdiff(0): renamed and modified' \
 283        'cat >file2<<EOF &&
 284Dominus regit me,
 285et nihil mihi deerit.
 286In loco pascuae ibi me collocavit,
 287super aquam refectionis educavit me;
 288animam meam convertit,
 289deduxit me super semitas jusitiae,
 290propter nomen suum.
 291EOF
 292         git commit -a -m "File added." &&
 293         git mv file2 file3 &&
 294         echo "Propter nomen suum." >> file3 &&
 295         git commit -a -m "File rename and modification." &&
 296         gitweb_run "p=.git;a=commitdiff"'
 297test_debug 'cat gitweb.log'
 298
 299test_expect_success \
 300        'commitdiff(0): renamed, mode change and modified' \
 301        'git mv file3 file2 &&
 302         echo "Propter nomen suum." >> file2 &&
 303         test_chmod +x file2 &&
 304         git commit -a -m "File rename, mode change and modification." &&
 305         gitweb_run "p=.git;a=commitdiff"'
 306test_debug 'cat gitweb.log'
 307
 308# ----------------------------------------------------------------------
 309# commitdiff testing (taken from t4114-apply-typechange.sh)
 310
 311test_expect_success SYMLINKS 'setup typechange commits' '
 312        echo "hello world" > foo &&
 313        echo "hi planet" > bar &&
 314        git update-index --add foo bar &&
 315        git commit -m initial &&
 316        git branch initial &&
 317        rm -f foo &&
 318        ln -s bar foo &&
 319        git update-index foo &&
 320        git commit -m "foo symlinked to bar" &&
 321        git branch foo-symlinked-to-bar &&
 322        rm -f foo &&
 323        echo "how far is the sun?" > foo &&
 324        git update-index foo &&
 325        git commit -m "foo back to file" &&
 326        git branch foo-back-to-file &&
 327        rm -f foo &&
 328        git update-index --remove foo &&
 329        mkdir foo &&
 330        echo "if only I knew" > foo/baz &&
 331        git update-index --add foo/baz &&
 332        git commit -m "foo becomes a directory" &&
 333        git branch "foo-becomes-a-directory" &&
 334        echo "hello world" > foo/baz &&
 335        git update-index foo/baz &&
 336        git commit -m "foo/baz is the original foo" &&
 337        git branch foo-baz-renamed-from-foo
 338        '
 339
 340test_expect_success \
 341        'commitdiff(2): file renamed from foo to foo/baz' \
 342        'gitweb_run "p=.git;a=commitdiff;hp=initial;h=foo-baz-renamed-from-foo"'
 343test_debug 'cat gitweb.log'
 344
 345test_expect_success \
 346        'commitdiff(2): file renamed from foo/baz to foo' \
 347        'gitweb_run "p=.git;a=commitdiff;hp=foo-baz-renamed-from-foo;h=initial"'
 348test_debug 'cat gitweb.log'
 349
 350test_expect_success \
 351        'commitdiff(2): directory becomes file' \
 352        'gitweb_run "p=.git;a=commitdiff;hp=foo-becomes-a-directory;h=initial"'
 353test_debug 'cat gitweb.log'
 354
 355test_expect_success \
 356        'commitdiff(2): file becomes directory' \
 357        'gitweb_run "p=.git;a=commitdiff;hp=initial;h=foo-becomes-a-directory"'
 358test_debug 'cat gitweb.log'
 359
 360test_expect_success \
 361        'commitdiff(2): file becomes symlink' \
 362        'gitweb_run "p=.git;a=commitdiff;hp=initial;h=foo-symlinked-to-bar"'
 363test_debug 'cat gitweb.log'
 364
 365test_expect_success \
 366        'commitdiff(2): symlink becomes file' \
 367        'gitweb_run "p=.git;a=commitdiff;hp=foo-symlinked-to-bar;h=foo-back-to-file"'
 368test_debug 'cat gitweb.log'
 369
 370test_expect_success \
 371        'commitdiff(2): symlink becomes directory' \
 372        'gitweb_run "p=.git;a=commitdiff;hp=foo-symlinked-to-bar;h=foo-becomes-a-directory"'
 373test_debug 'cat gitweb.log'
 374
 375test_expect_success \
 376        'commitdiff(2): directory becomes symlink' \
 377        'gitweb_run "p=.git;a=commitdiff;hp=foo-becomes-a-directory;h=foo-symlinked-to-bar"'
 378test_debug 'cat gitweb.log'
 379
 380# ----------------------------------------------------------------------
 381# commit, commitdiff: merge, large
 382test_expect_success \
 383        'Create a merge' \
 384        'git checkout b &&
 385         echo "Branch" >> b &&
 386         git add b &&
 387         git commit -a -m "On branch" &&
 388         git checkout master &&
 389         git pull . b'
 390
 391test_expect_success \
 392        'commit(0): merge commit' \
 393        'gitweb_run "p=.git;a=commit"'
 394test_debug 'cat gitweb.log'
 395
 396test_expect_success \
 397        'commitdiff(0): merge commit' \
 398        'gitweb_run "p=.git;a=commitdiff"'
 399test_debug 'cat gitweb.log'
 400
 401test_expect_success \
 402        'Prepare large commit' \
 403        'git checkout b &&
 404         echo "To be changed" > 01-change &&
 405         echo "To be renamed" > 02-pure-rename-from &&
 406         echo "To be deleted" > 03-delete &&
 407         echo "To be renamed and changed" > 04-rename-from &&
 408         echo "To have mode changed" > 05-mode-change &&
 409         echo "File to symlink" > 06-file-or-symlink &&
 410         echo "To be changed and have mode changed" > 07-change-mode-change     &&
 411         git add 0* &&
 412         git commit -a -m "Prepare large commit" &&
 413         echo "Changed" > 01-change &&
 414         git mv 02-pure-rename-from 02-pure-rename-to &&
 415         git rm 03-delete && rm -f 03-delete &&
 416         echo "A new file" > 03-new &&
 417         git add 03-new &&
 418         git mv 04-rename-from 04-rename-to &&
 419         echo "Changed" >> 04-rename-to &&
 420         test_chmod +x 05-mode-change &&
 421         rm -f 06-file-or-symlink &&
 422         if test_have_prereq SYMLINKS; then
 423                ln -s 01-change 06-file-or-symlink
 424         else
 425                printf %s 01-change > 06-file-or-symlink
 426         fi &&
 427         echo "Changed and have mode changed" > 07-change-mode-change   &&
 428         test_chmod +x 07-change-mode-change &&
 429         git commit -a -m "Large commit" &&
 430         git checkout master'
 431
 432test_expect_success \
 433        'commit(1): large commit' \
 434        'gitweb_run "p=.git;a=commit;h=b"'
 435test_debug 'cat gitweb.log'
 436
 437test_expect_success \
 438        'commitdiff(1): large commit' \
 439        'gitweb_run "p=.git;a=commitdiff;h=b"'
 440test_debug 'cat gitweb.log'
 441
 442# ----------------------------------------------------------------------
 443# tags testing
 444
 445test_expect_success \
 446        'tags: list of different types of tags' \
 447        'git checkout master &&
 448         git tag -a -m "Tag commit object" tag-commit HEAD &&
 449         git tag -a -m "" tag-commit-nomessage HEAD &&
 450         git tag -a -m "Tag tag object" tag-tag tag-commit &&
 451         git tag -a -m "Tag tree object" tag-tree HEAD^{tree} &&
 452         git tag -a -m "Tag blob object" tag-blob HEAD:file &&
 453         git tag lightweight/tag-commit HEAD &&
 454         git tag lightweight/tag-tag tag-commit &&
 455         git tag lightweight/tag-tree HEAD^{tree} &&
 456         git tag lightweight/tag-blob HEAD:file &&
 457         gitweb_run "p=.git;a=tags"'
 458test_debug 'cat gitweb.log'
 459
 460test_expect_success \
 461        'tag: Tag to commit object' \
 462        'gitweb_run "p=.git;a=tag;h=tag-commit"'
 463test_debug 'cat gitweb.log'
 464
 465test_expect_success \
 466        'tag: on lightweight tag (invalid)' \
 467        'gitweb_run "p=.git;a=tag;h=lightweight/tag-commit"'
 468test_debug 'cat gitweb.log'
 469
 470# ----------------------------------------------------------------------
 471# logs
 472
 473test_expect_success \
 474        'logs: log (implicit HEAD)' \
 475        'gitweb_run "p=.git;a=log"'
 476test_debug 'cat gitweb.log'
 477
 478test_expect_success \
 479        'logs: shortlog (implicit HEAD)' \
 480        'gitweb_run "p=.git;a=shortlog"'
 481test_debug 'cat gitweb.log'
 482
 483test_expect_success \
 484        'logs: history (implicit HEAD, file)' \
 485        'gitweb_run "p=.git;a=history;f=file"'
 486test_debug 'cat gitweb.log'
 487
 488test_expect_success \
 489        'logs: history (implicit HEAD, non-existent file)' \
 490        'gitweb_run "p=.git;a=history;f=non-existent"'
 491test_debug 'cat gitweb.log'
 492
 493test_expect_success \
 494        'logs: history (implicit HEAD, deleted file)' \
 495        'git checkout master &&
 496         echo "to be deleted" > deleted_file &&
 497         git add deleted_file &&
 498         git commit -m "Add file to be deleted" &&
 499         git rm deleted_file &&
 500         git commit -m "Delete file" &&
 501         gitweb_run "p=.git;a=history;f=deleted_file"'
 502test_debug 'cat gitweb.log'
 503
 504# ----------------------------------------------------------------------
 505# path_info links
 506test_expect_success \
 507        'path_info: project' \
 508        'gitweb_run "" "/.git"'
 509test_debug 'cat gitweb.log'
 510
 511test_expect_success \
 512        'path_info: project/branch' \
 513        'gitweb_run "" "/.git/b"'
 514test_debug 'cat gitweb.log'
 515
 516test_expect_success \
 517        'path_info: project/branch:file' \
 518        'gitweb_run "" "/.git/master:file"'
 519test_debug 'cat gitweb.log'
 520
 521test_expect_success \
 522        'path_info: project/branch:dir/' \
 523        'gitweb_run "" "/.git/master:foo/"'
 524test_debug 'cat gitweb.log'
 525
 526test_expect_success \
 527        'path_info: project/branch:file (non-existent)' \
 528        'gitweb_run "" "/.git/master:non-existent"'
 529test_debug 'cat gitweb.log'
 530
 531test_expect_success \
 532        'path_info: project/branch:dir/ (non-existent)' \
 533        'gitweb_run "" "/.git/master:non-existent/"'
 534test_debug 'cat gitweb.log'
 535
 536
 537test_expect_success \
 538        'path_info: project/branch:/file' \
 539        'gitweb_run "" "/.git/master:/file"'
 540test_debug 'cat gitweb.log'
 541
 542test_expect_success \
 543        'path_info: project/:/file (implicit HEAD)' \
 544        'gitweb_run "" "/.git/:/file"'
 545test_debug 'cat gitweb.log'
 546
 547test_expect_success \
 548        'path_info: project/:/ (implicit HEAD, top tree)' \
 549        'gitweb_run "" "/.git/:/"'
 550test_debug 'cat gitweb.log'
 551
 552
 553# ----------------------------------------------------------------------
 554# feed generation
 555
 556test_expect_success \
 557        'feeds: OPML' \
 558        'gitweb_run "a=opml"'
 559test_debug 'cat gitweb.log'
 560
 561test_expect_success \
 562        'feed: RSS' \
 563        'gitweb_run "p=.git;a=rss"'
 564test_debug 'cat gitweb.log'
 565
 566test_expect_success \
 567        'feed: Atom' \
 568        'gitweb_run "p=.git;a=atom"'
 569test_debug 'cat gitweb.log'
 570
 571# ----------------------------------------------------------------------
 572# encoding/decoding
 573
 574test_expect_success \
 575        'encode(commit): utf8' \
 576        '. "$TEST_DIRECTORY"/t3901-utf8.txt &&
 577         echo "UTF-8" >> file &&
 578         git add file &&
 579         git commit -F "$TEST_DIRECTORY"/t3900/1-UTF-8.txt &&
 580         gitweb_run "p=.git;a=commit"'
 581test_debug 'cat gitweb.log'
 582
 583test_expect_success \
 584        'encode(commit): iso-8859-1' \
 585        '. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
 586         echo "ISO-8859-1" >> file &&
 587         git add file &&
 588         git config i18n.commitencoding ISO-8859-1 &&
 589         git commit -F "$TEST_DIRECTORY"/t3900/ISO-8859-1.txt &&
 590         git config --unset i18n.commitencoding &&
 591         gitweb_run "p=.git;a=commit"'
 592test_debug 'cat gitweb.log'
 593
 594test_expect_success \
 595        'encode(log): utf-8 and iso-8859-1' \
 596        'gitweb_run "p=.git;a=log"'
 597test_debug 'cat gitweb.log'
 598
 599# ----------------------------------------------------------------------
 600# extra options
 601
 602test_expect_success \
 603        'opt: log --no-merges' \
 604        'gitweb_run "p=.git;a=log;opt=--no-merges"'
 605test_debug 'cat gitweb.log'
 606
 607test_expect_success \
 608        'opt: atom --no-merges' \
 609        'gitweb_run "p=.git;a=log;opt=--no-merges"'
 610test_debug 'cat gitweb.log'
 611
 612test_expect_success \
 613        'opt: "file" history --no-merges' \
 614        'gitweb_run "p=.git;a=history;f=file;opt=--no-merges"'
 615test_debug 'cat gitweb.log'
 616
 617test_expect_success \
 618        'opt: log --no-such-option (invalid option)' \
 619        'gitweb_run "p=.git;a=log;opt=--no-such-option"'
 620test_debug 'cat gitweb.log'
 621
 622test_expect_success \
 623        'opt: tree --no-merges (invalid option for action)' \
 624        'gitweb_run "p=.git;a=tree;opt=--no-merges"'
 625test_debug 'cat gitweb.log'
 626
 627# ----------------------------------------------------------------------
 628# testing config_to_multi / cloneurl
 629
 630test_expect_success \
 631       'URL: no project URLs, no base URL' \
 632       'gitweb_run "p=.git;a=summary"'
 633test_debug 'cat gitweb.log'
 634
 635test_expect_success \
 636       'URL: project URLs via gitweb.url' \
 637       'git config --add gitweb.url git://example.com/git/trash.git &&
 638        git config --add gitweb.url http://example.com/git/trash.git &&
 639        gitweb_run "p=.git;a=summary"'
 640test_debug 'cat gitweb.log'
 641
 642cat >.git/cloneurl <<\EOF
 643git://example.com/git/trash.git
 644http://example.com/git/trash.git
 645EOF
 646
 647test_expect_success \
 648       'URL: project URLs via cloneurl file' \
 649       'gitweb_run "p=.git;a=summary"'
 650test_debug 'cat gitweb.log'
 651
 652# ----------------------------------------------------------------------
 653# gitweb config and repo config
 654
 655cat >>gitweb_config.perl <<EOF
 656
 657\$feature{'blame'}{'override'} = 1;
 658\$feature{'snapshot'}{'override'} = 1;
 659EOF
 660
 661test_expect_success \
 662        'config override: tree view, features not overridden in repo config' \
 663        'gitweb_run "p=.git;a=tree"'
 664test_debug 'cat gitweb.log'
 665
 666test_expect_success \
 667        'config override: tree view, features disabled in repo config' \
 668        'git config gitweb.blame no &&
 669         git config gitweb.snapshot none &&
 670         gitweb_run "p=.git;a=tree"'
 671test_debug 'cat gitweb.log'
 672
 673test_expect_success \
 674        'config override: tree view, features enabled in repo config (1)' \
 675        'git config gitweb.blame yes &&
 676         git config gitweb.snapshot "zip,tgz, tbz2" &&
 677         gitweb_run "p=.git;a=tree"'
 678test_debug 'cat gitweb.log'
 679
 680cat >.git/config <<\EOF
 681# testing noval and alternate separator
 682[gitweb]
 683        blame
 684        snapshot = zip tgz
 685EOF
 686test_expect_success \
 687        'config override: tree view, features enabled in repo config (2)' \
 688        'gitweb_run "p=.git;a=tree"'
 689test_debug 'cat gitweb.log'
 690
 691# ----------------------------------------------------------------------
 692# non-ASCII in README.html
 693
 694test_expect_success \
 695        'README.html with non-ASCII characters (utf-8)' \
 696        'echo "<b>UTF-8 example:</b><br />" > .git/README.html &&
 697         cat "$TEST_DIRECTORY"/t3900/1-UTF-8.txt >> .git/README.html &&
 698         gitweb_run "p=.git;a=summary"'
 699test_debug 'cat gitweb.log'
 700
 701test_done