Code

Merge branch 'jc/fetch-verify'
authorJunio C Hamano <gitster@pobox.com>
Wed, 5 Oct 2011 19:36:20 +0000 (12:36 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Oct 2011 19:36:20 +0000 (12:36 -0700)
* jc/fetch-verify:
  fetch: verify we have everything we need before updating our ref
  rev-list --verify-object
  list-objects: pass callback data to show_objects()

1  2 
builtin/fetch.c
builtin/pack-objects.c
revision.c
revision.h
t/t5504-fetch-receive-strict.sh
upload-pack.c

diff --cc builtin/fetch.c
Simple merge
Simple merge
diff --cc revision.c
Simple merge
diff --cc revision.h
Simple merge
index 66100124a94779940d4057f958ebc400168ad1c9,0000000000000000000000000000000000000000..8341fc4d154f6d50bf9055b206810dea4e1b807b
mode 100755,000000..100755
--- /dev/null
@@@ -1,104 -1,0 +1,104 @@@
-               git fetch ../.git master
 +#!/bin/sh
 +
 +test_description='fetch/receive strict mode'
 +. ./test-lib.sh
 +
 +test_expect_success setup '
 +      echo hello >greetings &&
 +      git add greetings &&
 +      git commit -m greetings &&
 +
 +      S=$(git rev-parse :greetings | sed -e "s|^..|&/|") &&
 +      X=$(echo bye | git hash-object -w --stdin | sed -e "s|^..|&/|") &&
 +      mv -f .git/objects/$X .git/objects/$S &&
 +
 +      test_must_fail git fsck
 +'
 +
 +test_expect_success 'fetch without strict' '
 +      rm -rf dst &&
 +      git init dst &&
 +      (
 +              cd dst &&
 +              git config fetch.fsckobjects false &&
 +              git config transfer.fsckobjects false &&
-               git fetch ../.git master
++              test_must_fail git fetch ../.git master
 +      )
 +'
 +
 +test_expect_success 'fetch with !fetch.fsckobjects' '
 +      rm -rf dst &&
 +      git init dst &&
 +      (
 +              cd dst &&
 +              git config fetch.fsckobjects false &&
 +              git config transfer.fsckobjects true &&
++              test_must_fail git fetch ../.git master
 +      )
 +'
 +
 +test_expect_success 'fetch with fetch.fsckobjects' '
 +      rm -rf dst &&
 +      git init dst &&
 +      (
 +              cd dst &&
 +              git config fetch.fsckobjects true &&
 +              git config transfer.fsckobjects false &&
 +              test_must_fail git fetch ../.git master
 +      )
 +'
 +
 +test_expect_success 'fetch with transfer.fsckobjects' '
 +      rm -rf dst &&
 +      git init dst &&
 +      (
 +              cd dst &&
 +              git config transfer.fsckobjects true &&
 +              test_must_fail git fetch ../.git master
 +      )
 +'
 +
 +test_expect_success 'push without strict' '
 +      rm -rf dst &&
 +      git init dst &&
 +      (
 +              cd dst &&
 +              git config fetch.fsckobjects false &&
 +              git config transfer.fsckobjects false
 +      ) &&
 +      git push dst master:refs/heads/test
 +'
 +
 +test_expect_success 'push with !receive.fsckobjects' '
 +      rm -rf dst &&
 +      git init dst &&
 +      (
 +              cd dst &&
 +              git config receive.fsckobjects false &&
 +              git config transfer.fsckobjects true
 +      ) &&
 +      git push dst master:refs/heads/test
 +'
 +
 +test_expect_success 'push with receive.fsckobjects' '
 +      rm -rf dst &&
 +      git init dst &&
 +      (
 +              cd dst &&
 +              git config receive.fsckobjects true &&
 +              git config transfer.fsckobjects false
 +      ) &&
 +      test_must_fail git push dst master:refs/heads/test
 +'
 +
 +test_expect_success 'push with transfer.fsckobjects' '
 +      rm -rf dst &&
 +      git init dst &&
 +      (
 +              cd dst &&
 +              git config transfer.fsckobjects true
 +      ) &&
 +      test_must_fail git push dst master:refs/heads/test
 +'
 +
 +test_done
diff --cc upload-pack.c
Simple merge