Merge branch 'jk/repack-silence-auto-bitmap-warning'
authorJunio C Hamano <gitster@pobox.com>
Thu, 1 Aug 2019 16:10:50 +0000 (09:10 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 1 Aug 2019 16:10:50 +0000 (09:10 -0700)
Squelch unneeded and misleading warnings from "repack" when the
command attempts to generate pack bitmaps without explicitly asked
for by the user.

* jk/repack-silence-auto-bitmap-warning:
repack: simplify handling of auto-bitmaps and .keep files
repack: silence warnings when auto-enabled bitmaps cannot be built
t7700: clean up .keep file in bitmap-writing test

24 files changed:
Documentation/RelNotes/2.22.1.txt
Documentation/RelNotes/2.23.0.txt
builtin/verify-commit.c
builtin/verify-tag.c
t/helper/test-dir-iterator.c
t/t0011-hashmap.sh
t/t0016-oidmap.sh
t/t0027-auto-crlf.sh
t/t0066-dir-iterator.sh
t/t0090-cache-tree.sh
t/t1007-hash-object.sh
t/t1410-reflog.sh
t/t1450-fsck.sh
t/t1700-split-index.sh
t/t2203-add-intent.sh
t/t5000-tar-tree.sh
t/t5000/19f9c8273ec45a8938e6999cb59b3ff66739902a [deleted file]
t/t5000/huge-object [new file with mode: 0644]
t/t6030-bisect-porcelain.sh
t/test-lib-functions.sh
wt-status.h
xdiff/xhistogram.c
xdiff/xpatience.c
xdiff/xutils.c
index 78b2c5ea8ad51cdff9bcd68e53a12269ba723d29..76dd8fb578b54ab66044518bad521b0c53a8a61c 100644 (file)
@@ -94,7 +94,7 @@ Fixes since v2.22
 
  * The configuration variable rebase.rescheduleFailedExec should be
    effective only while running an interactive rebase and should not
-   affect anything when running an non-interactive one, which was not
+   affect anything when running a non-interactive one, which was not
    the case.  This has been corrected.
 
  * "git submodule foreach" did not protect command line options passed
index 9896599b2f3a4bb559dd3db52bfdea461ac3a69b..e1b1ce56808151c71a149ff03fdfe05028dc79bb 100644 (file)
@@ -52,7 +52,7 @@ UI, Workflows & Features
 
  * "git fetch" and "git pull" reports when a fetch results in
    non-fast-forward updates to let the user notice unusual situation.
-   The commands learned "--no-shown-forced-updates" option to disable
+   The commands learned "--no-show-forced-updates" option to disable
    this safety feature.
 
  * Two new commands "git switch" and "git restore" are introduced to
@@ -68,7 +68,7 @@ UI, Workflows & Features
  * The conditional inclusion mechanism learned to base the choice on
    the branch the HEAD currently is on.
 
- * "git rev-list --objects" learned with "--no-object-names" option to
+ * "git rev-list --objects" learned the "--no-object-names" option to
    squelch the path to the object that is used as a grouping hint for
    pack-objects.
 
@@ -106,7 +106,7 @@ Performance, Internal Implementation, Development Support etc.
    no longer be used.
 
  * Developer support to emulate unsatisfied prerequisites in tests to
-   ensure that the remainer of the tests still succeeds when tests
+   ensure that the remainder of the tests still succeeds when tests
    with prerequisites are skipped.
 
  * "git update-server-info" learned not to rewrite the file with the
@@ -121,7 +121,7 @@ Performance, Internal Implementation, Development Support etc.
  * Prepare use of reachability index in topological walker that works
    on a range (A..B).
 
- * A new tutorial targetting specifically aspiring git-core
+ * A new tutorial targeting specifically aspiring git-core
    developers has been added.
 
  * Auto-detect how to tell HP-UX aCC where to use dynamically linked
@@ -163,7 +163,6 @@ Performance, Internal Implementation, Development Support etc.
  * We have been trying out a few language features outside c89; the
    coding guidelines document did not talk about them and instead had
    a blanket ban against them.
-   (merge cc0c42975a jc/post-c89-rules-doc later to maint).
 
  * A test helper has been introduced to optimize preparation of test
    repositories with many simple commits, and a handful of test
@@ -177,16 +176,13 @@ Fixes since v2.22
    ought to be relative to the directory "git init" gets invoked in,
    but it instead was made relative to the repository, which has been
    corrected.
-   (merge e1df7fe43f nd/init-relative-template-fix later to maint).
 
  * "git worktree add" used to fail when another worktree connected to
    the same repository was corrupt, which has been corrected.
-   (merge 105df73e71 nd/corrupt-worktrees later to maint).
 
  * The ownership rule for the file descriptor to fast-import remote
-   backend was mixed up, leading to unrelated file descriptor getting
+   backend was mixed up, leading to an unrelated file descriptor getting
    closed, which has been fixed.
-   (merge 3203566a71 mh/import-transport-fd-fix later to maint).
 
  * A "merge -c" instruction during "git rebase --rebase-merges" should
    give the user a chance to edit the log message, even when there is
@@ -195,82 +191,65 @@ Fixes since v2.22
    corrected.
 
  * Code cleanup and futureproof.
-   (merge 31f5256c82 ds/object-info-for-prefetch-fix later to maint).
 
  * More parameter validation.
-   (merge de99eb0c24 es/grep-require-name-when-needed later to maint).
 
  * "git update-server-info" used to leave stale packfiles in its
    output, which has been corrected.
-   (merge e941c48d49 ew/server-info-remove-crufts later to maint).
 
  * The server side support for "git fetch" used to show incorrect
    value for the HEAD symbolic ref when the namespace feature is in
    use, which has been corrected.
-   (merge 533e088250 jk/HEAD-symref-in-xfer-namespaces later to maint).
 
  * "git am -i --resolved" segfaulted after trying to see a commit as
    if it were a tree, which has been corrected.
-   (merge 7663e438c5 jk/am-i-resolved-fix later to maint).
 
  * "git bundle verify" needs to see if prerequisite objects exist in
    the receiving repository, but the command did not check if we are
    in a repository upfront, which has been corrected.
-   (merge 3bbbe467f2 js/bundle-verify-require-object-store later to maint).
 
  * "git merge --squash" is designed to update the working tree and the
    index without creating the commit, and this cannot be countermanded
    by adding the "--commit" option; the command now refuses to work
    when both options are given.
-   (merge 1d14d0c994 vv/merge-squash-with-explicit-commit later to maint).
 
  * The data collected by fsmonitor was not properly written back to
    the on-disk index file, breaking t7519 tests occasionally, which
    has been corrected.
-   (merge b5a8169752 js/fsmonitor-unflake later to maint).
 
  * Update to Unicode 12.1 width table.
-   (merge 5817f9caa3 bb/unicode-12.1-reiwa later to maint).
 
  * The command line to invoke a "git cat-file" command from inside
    "git p4" was not properly quoted to protect a caret and running a
    broken command on Windows, which has been corrected.
-   (merge c3f2358de3 mm/p4-unshelve-windows-fix later to maint).
 
  * "git request-pull" learned to warn when the ref we ask them to pull
    from in the local repository and in the published repository are
    different.
-   (merge 0454220d66 pb/request-pull-verify-remote-ref later to maint).
 
  * When creating a partial clone, the object filtering criteria is
    recorded for the origin of the clone, but this incorrectly used a
    hardcoded name "origin" to name that remote; it has been corrected
    to honor the "--origin <name>" option.
-   (merge 1c4a9f9114 xl/record-partial-clone-origin later to maint).
 
  * "git fetch" into a lazy clone forgot to fetch base objects that are
    necessary to complete delta in a thin packfile, which has been
    corrected.
-   (merge 810e19322d jt/partial-clone-missing-ref-delta-base later to maint).
 
  * The filter_data used in the list-objects-filter (which manages a
    lazily sparse clone repository) did not use the dynamic array API
    correctly---'nr' is supposed to point at one past the last element
    of the array in use.  This has been corrected.
-   (merge 7140600e2e md/list-objects-filter-memfix later to maint).
 
  * The description about slashes in gitignore patterns (used to
    indicate things like "anchored to this level only" and "only
    matches directories") has been revamped.
-   (merge 1a58bad014 an/ignore-doc-update later to maint).
 
  * The URL decoding code has been updated to avoid going past the end
    of the string while parsing %-<hex>-<hex> sequence.
-   (merge d37dc239a4 md/url-parse-harden later to maint).
 
  * The list of for-each like macros used by clang-format has been
    updated.
-   (merge fc7e03aace mo/clang-format-for-each-update later to maint).
 
  * "git branch --list" learned to show branches that are checked out
    in other worktrees connected to the same repository prefixed with
@@ -280,48 +259,38 @@ Fixes since v2.22
 
  * Code restructuring during 2.20 period broke fetching tags via
    "import" based transports.
-   (merge f80d922355 fc/fetch-with-import-fix later to maint).
 
  * The commit-graph file is now part of the "files that the runtime
    may keep open file descriptors on, all of which would need to be
    closed when done with the object store", and the file descriptor to
    an existing commit-graph file now is closed before "gc" finalizes a
    new instance to replace it.
-   (merge 2d511cfc0b ds/close-object-store later to maint).
 
  * "git checkout -p" needs to selectively apply a patch in reverse,
    which did not work well.
-   (merge 2bd69b9024 pw/add-p-recount later to maint).
 
  * Code clean-up to avoid signed integer wraparounds during binary search.
-   (merge 568a05c5ec rs/avoid-overflow-in-midpoint-computation later to maint).
 
  * "git interpret-trailers" always treated '#' as the comment
    character, regardless of core.commentChar setting, which has been
    corrected.
-   (merge 29c83fc23f jk/trailers-use-config later to maint).
 
  * "git stash show 23" used to work, but no more after getting
    rewritten in C; this regression has been corrected.
-   (merge 63b50c8ffe tg/stash-ref-by-index-fix later to maint).
 
  * "git rebase --abort" used to leave refs/rewritten/ when concluding
    "git rebase -r", which has been corrected.
-   (merge d559f502c5 pw/rebase-abort-clean-rewritten later to maint).
 
  * An incorrect list of options was cached after command line
    completion failed (e.g. trying to complete a command that requires
    a repository outside one), which has been corrected.
-   (merge 69702523af nd/completion-no-cache-failure later to maint).
 
  * The code to parse scaled numbers out of configuration files has
    been made more robust and also easier to follow.
-   (merge 39c575c969 rs/config-unit-parsing later to maint).
 
  * The codepath to compute delta islands used to spew progress output
    without giving the callers any way to squelch it, which has been
    fixed.
-   (merge bdbdf42f8a jk/delta-islands-progress-fix later to maint).
 
  * Protocol capabilities that go over wire should never be translated,
    but it was incorrectly marked for translation, which has been
@@ -330,23 +299,19 @@ Fixes since v2.22
 
  * Use "Erase in Line" CSI sequence that is already used in the editor
    support to clear cruft in the progress output.
-   (merge 5b12e3123b sg/rebase-progress later to maint).
 
  * "git submodule foreach" did not protect command line options passed
    to the command to be run in each submodule correctly, when the
    "--recursive" option was in use.
-   (merge 30db18b148 ms/submodule-foreach-fix later to maint).
 
  * The configuration variable rebase.rescheduleFailedExec should be
    effective only while running an interactive rebase and should not
-   affect anything when running an non-interactive one, which was not
+   affect anything when running a non-interactive one, which was not
    the case.  This has been corrected.
-   (merge 906b63942a js/rebase-reschedule-applies-only-to-interactive later to maint).
 
  * The "git clone" documentation refers to command line options in its
    description in the short form; they have been replaced with long
    forms to make them more recognisable.
-   (merge bfc8c84ed5 qn/clone-doc-use-long-form later to maint).
 
  * Generation of pack bitmaps are now disabled when .keep files exist,
    as these are mutually exclusive features.
@@ -355,56 +320,30 @@ Fixes since v2.22
  * "git rm" to resolve a conflicted path leaked an internal message
    "needs merge" before actually removing the path, which was
    confusing.  This has been corrected.
-   (merge b2b1f615ce jc/denoise-rm-to-resolve later to maint).
 
  * "git stash --keep-index" did not work correctly on paths that have
    been removed, which has been fixed.
    (merge b932f6a5e8 tg/stash-keep-index-with-removed-paths later to maint).
 
  * Window 7 update ;-)
-   (merge eb7c786314 js/mingw-spawn-with-spaces-in-path later to maint).
 
  * A codepath that reads from GPG for signed object verification read
    past the end of allocated buffer, which has been fixed.
-   (merge 64c45dc72e sr/gpg-interface-stop-at-the-end later to maint).
 
  * "git clean" silently skipped a path when it cannot lstat() it; now
    it gives a warning.
-   (merge b09364c47a js/clean-report-too-long-a-path later to maint).
 
  * "git push --atomic" that goes over the transport-helper (namely,
    the smart http transport) failed to prevent refs to be pushed when
    it can locally tell that one of the ref update will fail without
    having to consult the other end, which has been corrected.
-   (merge 2581ea3d31 es/local-atomic-push-failure-with-http later to maint).
 
  * The internal diff machinery can be made to read out of bounds while
-   looking for --funcion-context line in a corner case, which has been
+   looking for --function-context line in a corner case, which has been
    corrected.
    (merge b777f3fd61 jk/xdiff-clamp-funcname-context-index later to maint).
 
  * Other code cleanup, docfix, build fix, etc.
-   (merge f547101b26 es/git-debugger-doc later to maint).
-   (merge 7877ac3d7b js/bisect-helper-check-get-oid-return-value later to maint).
-   (merge 0108f47eb3 sw/git-p4-unshelve-branched-files later to maint).
-   (merge 9df8f734fd cm/send-email-document-req-modules later to maint).
-   (merge afc3bf6eb1 ab/hash-object-doc later to maint).
-   (merge 1fde99cfc7 po/doc-branch later to maint).
-   (merge 459842e1c2 dl/config-alias-doc later to maint).
-   (merge 5d137fc2c7 cb/fsmonitor-intfix later to maint).
-   (merge 921d49be86 rs/copy-array later to maint).
-   (merge cc8d872e69 js/t3404-typofix later to maint).
-   (merge 729a9b558b cb/mkstemps-uint-type-fix later to maint).
-   (merge 9dae4fe79f js/gcc-8-and-9 later to maint).
-   (merge ed33bd8f30 js/t0001-case-insensitive later to maint).
-   (merge dfa880e336 jw/gitweb-sample-update later to maint).
-   (merge e532a90a9f sg/t5551-fetch-smart-error-is-translated later to maint).
-   (merge 8d45ad8c29 jt/t5551-test-chunked later to maint).
-   (merge 1a64e07d23 sg/git-C-empty-doc later to maint).
-   (merge 37a2e35395 sg/ci-brew-gcc-workaround later to maint).
-   (merge 24df0d49c4 js/trace2-signo-typofix later to maint).
    (merge fbec05c210 cc/test-oidmap later to maint).
-   (merge 7926cee904 di/readme-markup-fix later to maint).
-   (merge 02638d1e11 vn/xmmap-gently later to maint).
-   (merge f7bf24d4dd rm/gpg-program-doc-fix later to maint).
-   (merge 3aef54e8b8 js/unmap-before-ext-diff later to maint).
+   (merge 7a06fb038c jk/no-system-includes-in-dot-c later to maint).
+   (merge 81ed2b405c cb/xdiff-no-system-includes-in-dot-c later to maint).
index 4b9e823f8f9656b686f22ac4bb531f7d63f325ee..40c69a0bedde5be02af557fd0c92efc1d2c857e5 100644 (file)
@@ -12,7 +12,6 @@
 #include "repository.h"
 #include "commit.h"
 #include "run-command.h"
-#include <signal.h>
 #include "parse-options.h"
 #include "gpg-interface.h"
 
index 6fa04b751ac1d6ae18b8a42e700e2cefa6427a41..f45136a06ba76077891d9e5fae545ee8c297ddff 100644 (file)
@@ -10,7 +10,6 @@
 #include "builtin.h"
 #include "tag.h"
 #include "run-command.h"
-#include <signal.h>
 #include "parse-options.h"
 #include "gpg-interface.h"
 #include "ref-filter.h"
index a5b96cb0dcfd0e5b493638bc5d6a310ffbf87db3..c7c30664dad2a027c4cf6b0bac7ecb78080cbcf1 100644 (file)
@@ -4,6 +4,15 @@
 #include "iterator.h"
 #include "dir-iterator.h"
 
+static const char *error_name(int error_number)
+{
+       switch (error_number) {
+       case ENOENT: return "ENOENT";
+       case ENOTDIR: return "ENOTDIR";
+       default: return "ESOMETHINGELSE";
+       }
+}
+
 /*
  * usage:
  * tool-test dir-iterator [--follow-symlinks] [--pedantic] directory_path
@@ -31,7 +40,7 @@ int cmd__dir_iterator(int argc, const char **argv)
        diter = dir_iterator_begin(path.buf, flags);
 
        if (!diter) {
-               printf("dir_iterator_begin failure: %d\n", errno);
+               printf("dir_iterator_begin failure: %s\n", error_name(errno));
                exit(EXIT_FAILURE);
        }
 
index 9c96b3e3b10a99c20a1e6f5d4d0349c4fbcb0a10..5343ffd3f92c1637bb60719d812a01e0ab6d4064 100755 (executable)
@@ -170,31 +170,45 @@ NULL
 '
 
 test_expect_success 'iterate' '
-
-test_hashmap "put key1 value1
-put key2 value2
-put fooBarFrotz value3
-iterate" "NULL
-NULL
-NULL
-key2 value2
-key1 value1
-fooBarFrotz value3"
-
+       test-tool hashmap >actual.raw <<-\EOF &&
+       put key1 value1
+       put key2 value2
+       put fooBarFrotz value3
+       iterate
+       EOF
+
+       cat >expect <<-\EOF &&
+       NULL
+       NULL
+       NULL
+       fooBarFrotz value3
+       key1 value1
+       key2 value2
+       EOF
+
+       sort <actual.raw >actual &&
+       test_cmp expect actual
 '
 
 test_expect_success 'iterate (case insensitive)' '
-
-test_hashmap "put key1 value1
-put key2 value2
-put fooBarFrotz value3
-iterate" "NULL
-NULL
-NULL
-fooBarFrotz value3
-key2 value2
-key1 value1" ignorecase
-
+       test-tool hashmap ignorecase >actual.raw <<-\EOF &&
+       put key1 value1
+       put key2 value2
+       put fooBarFrotz value3
+       iterate
+       EOF
+
+       cat >expect <<-\EOF &&
+       NULL
+       NULL
+       NULL
+       fooBarFrotz value3
+       key1 value1
+       key2 value2
+       EOF
+
+       sort <actual.raw >actual &&
+       test_cmp expect actual
 '
 
 test_expect_success 'grow / shrink' '
index bbe719e9509689e38dd1d524d5d4b57de934a757..31f8276ba82bad3129c4a3cfa92f2d0ba798073c 100755 (executable)
@@ -86,17 +86,25 @@ NULL"
 '
 
 test_expect_success 'iterate' '
-
-test_oidmap "put one 1
-put two 2
-put three 3
-iterate" "NULL
-NULL
-NULL
-$(git rev-parse two) 2
-$(git rev-parse one) 1
-$(git rev-parse three) 3"
-
+       test-tool oidmap >actual.raw <<-\EOF &&
+       put one 1
+       put two 2
+       put three 3
+       iterate
+       EOF
+
+       # sort "expect" too so we do not rely on the order of particular oids
+       sort >expect <<-EOF &&
+       NULL
+       NULL
+       NULL
+       $(git rev-parse one) 1
+       $(git rev-parse two) 2
+       $(git rev-parse three) 3
+       EOF
+
+       sort <actual.raw >actual &&
+       test_cmp expect actual
 '
 
 test_done
index 3587e454f19d9bf71f2b02c9189d4715ed216fd9..959b6da449004c526d6f5d106d9061d9763108e9 100755 (executable)
@@ -15,8 +15,10 @@ compare_ws_file () {
        pfx=$1
        exp=$2.expect
        act=$pfx.actual.$3
-       tr '\015\000abcdef0123456789' QN00000000000000000 <"$2" >"$exp" &&
-       tr '\015\000abcdef0123456789' QN00000000000000000 <"$3" >"$act" &&
+       tr '\015\000abcdef0123456789' QN00000000000000000 <"$2" |
+               sed -e "s/0000*/$ZERO_OID/" >"$exp" &&
+       tr '\015\000abcdef0123456789' QN00000000000000000 <"$3" |
+               sed -e "s/0000*/$ZERO_OID/" >"$act" &&
        test_cmp "$exp" "$act" &&
        rm "$exp" "$act"
 }
index 9354d3f1ed42aef99f6f7c3d27c572903c3617da..92910e4e6c13ce381dddefcf197dea26a07efd88 100755 (executable)
@@ -55,13 +55,13 @@ test_expect_success 'dir-iterator should list files in the correct order' '
 test_expect_success 'begin should fail upon inexistent paths' '
        test_must_fail test-tool dir-iterator ./inexistent-path \
                >actual-inexistent-path-output &&
-       echo "dir_iterator_begin failure: 2" >expected-inexistent-path-output &&
+       echo "dir_iterator_begin failure: ENOENT" >expected-inexistent-path-output &&
        test_cmp expected-inexistent-path-output actual-inexistent-path-output
 '
 
 test_expect_success 'begin should fail upon non directory paths' '
        test_must_fail test-tool dir-iterator ./dir/b >actual-non-dir-output &&
-       echo "dir_iterator_begin failure: 20" >expected-non-dir-output &&
+       echo "dir_iterator_begin failure: ENOTDIR" >expected-non-dir-output &&
        test_cmp expected-non-dir-output actual-non-dir-output
 '
 
index 504334e552251ed0c1f74536f6fd09ffccda615d..ce9a4a5f324b74d61d8f0c8abcaee866cbe874e9 100755 (executable)
@@ -162,8 +162,8 @@ test_expect_success PERL 'commit --interactive gives cache-tree on partial commi
 '
 
 test_expect_success PERL 'commit -p with shrinking cache-tree' '
-       mkdir -p deep/subdir &&
-       echo content >deep/subdir/file &&
+       mkdir -p deep/very-long-subdir &&
+       echo content >deep/very-long-subdir/file &&
        git add deep &&
        git commit -m add &&
        git rm -r deep &&
index 7099d33508a0571cd8f960fcd80c46e4364f1766..64b340f227274c28f00a564a682f2369a7b85d8d 100755 (executable)
@@ -9,22 +9,19 @@ echo_without_newline() {
 }
 
 test_blob_does_not_exist() {
-       test_expect_success SHA1 'blob does not exist in database' "
+       test_expect_success 'blob does not exist in database' "
                test_must_fail git cat-file blob $1
        "
 }
 
 test_blob_exists() {
-       test_expect_success SHA1 'blob exists in database' "
+       test_expect_success 'blob exists in database' "
                git cat-file blob $1
        "
 }
 
 hello_content="Hello World"
-hello_sha1=5e1c309dae7f45e0f39b1bf3ac3cd9db12e7d689
-
 example_content="This is an example"
-example_sha1=ddd3f836d3e3fbb7ae289aa9ae83536f76956399
 
 setup_repo() {
        echo_without_newline "$hello_content" > hello
@@ -44,7 +41,16 @@ pop_repo() {
        rm -rf $test_repo
 }
 
-setup_repo
+test_expect_success 'setup' '
+       setup_repo &&
+       test_oid_cache <<-EOF
+       hello sha1:5e1c309dae7f45e0f39b1bf3ac3cd9db12e7d689
+       hello sha256:1e3b6c04d2eeb2b3e45c8a330445404c0b7cc7b257e2b097167d26f5230090c4
+
+       example sha1:ddd3f836d3e3fbb7ae289aa9ae83536f76956399
+       example sha256:b44fe1fe65589848253737db859bd490453510719d7424daab03daf0767b85ae
+       EOF
+'
 
 # Argument checking
 
@@ -73,23 +79,23 @@ test_expect_success "Can't use --path with --no-filters" '
 
 push_repo
 
-test_expect_success SHA1 'hash a file' '
-       test $hello_sha1 = $(git hash-object hello)
+test_expect_success 'hash a file' '
+       test "$(test_oid hello)" = $(git hash-object hello)
 '
 
-test_blob_does_not_exist $hello_sha1
+test_blob_does_not_exist "$(test_oid hello)"
 
-test_expect_success SHA1 'hash from stdin' '
-       test $example_sha1 = $(git hash-object --stdin < example)
+test_expect_success 'hash from stdin' '
+       test "$(test_oid example)" = $(git hash-object --stdin < example)
 '
 
-test_blob_does_not_exist $example_sha1
+test_blob_does_not_exist "$(test_oid example)"
 
-test_expect_success SHA1 'hash a file and write to database' '
-       test $hello_sha1 = $(git hash-object -w hello)
+test_expect_success 'hash a file and write to database' '
+       test "$(test_oid hello)" = $(git hash-object -w hello)
 '
 
-test_blob_exists $hello_sha1
+test_blob_exists "$(test_oid hello)"
 
 test_expect_success 'git hash-object --stdin file1 <file0 first operates on file0, then file1' '
        echo foo > file1 &&
@@ -161,11 +167,11 @@ pop_repo
 for args in "-w --stdin" "--stdin -w"; do
        push_repo
 
-       test_expect_success SHA1 "hash from stdin and write to database ($args)" '
-               test $example_sha1 = $(git hash-object $args < example)
+       test_expect_success "hash from stdin and write to database ($args)" '
+               test "$(test_oid example)" = $(git hash-object $args < example)
        '
 
-       test_blob_exists $example_sha1
+       test_blob_exists "$(test_oid example)"
 
        pop_repo
 done
@@ -173,22 +179,22 @@ done
 filenames="hello
 example"
 
-sha1s="$hello_sha1
-$example_sha1"
+oids="$(test_oid hello)
+$(test_oid example)"
 
-test_expect_success SHA1 "hash two files with names on stdin" '
-       test "$sha1s" = "$(echo_without_newline "$filenames" | git hash-object --stdin-paths)"
+test_expect_success "hash two files with names on stdin" '
+       test "$oids" = "$(echo_without_newline "$filenames" | git hash-object --stdin-paths)"
 '
 
 for args in "-w --stdin-paths" "--stdin-paths -w"; do
        push_repo
 
-       test_expect_success SHA1 "hash two files with names on stdin and write to database ($args)" '
-               test "$sha1s" = "$(echo_without_newline "$filenames" | git hash-object $args)"
+       test_expect_success "hash two files with names on stdin and write to database ($args)" '
+               test "$oids" = "$(echo_without_newline "$filenames" | git hash-object $args)"
        '
 
-       test_blob_exists $hello_sha1
-       test_blob_exists $example_sha1
+       test_blob_exists "$(test_oid hello)"
+       test_blob_exists "$(test_oid example)"
 
        pop_repo
 done
index 79f731db37cfa1a9e44fe4b966cbe6a72706ee94..82950c02825cf13322203697da81afa8b3ecee6f 100755 (executable)
@@ -30,14 +30,13 @@ check_fsck () {
 }
 
 corrupt () {
-       aa=${1%??????????????????????????????????????} zz=${1#??}
-       mv .git/objects/$aa/$zz .git/$aa$zz
+       mv .git/objects/$(test_oid_to_path $1) .git/$1
 }
 
 recover () {
-       aa=${1%??????????????????????????????????????} zz=${1#??}
+       aa=$(echo $1 | cut -c 1-2)
        mkdir -p .git/objects/$aa
-       mv .git/$aa$zz .git/objects/$aa/$zz
+       mv .git/$1 .git/objects/$(test_oid_to_path $1)
 }
 
 check_dont_have () {
@@ -55,6 +54,7 @@ check_dont_have () {
 }
 
 test_expect_success setup '
+       test_oid_init &&
        mkdir -p A/B &&
        echo rat >C &&
        echo ox >A/D &&
@@ -313,12 +313,12 @@ test_expect_success 'stale dirs do not cause d/f conflicts (reflogs off)' '
 # Each line is 114 characters, so we need 75 to still have a few before the
 # last 8K. The 89-character padding on the final entry lines up our
 # newline exactly.
-test_expect_success 'parsing reverse reflogs at BUFSIZ boundaries' '
+test_expect_success SHA1 'parsing reverse reflogs at BUFSIZ boundaries' '
        git checkout -b reflogskip &&
-       z38=00000000000000000000000000000000000000 &&
+       zf=$(test_oid zero_2) &&
        ident="abc <xyz> 0000000001 +0000" &&
        for i in $(test_seq 1 75); do
-               printf "$z38%02d $z38%02d %s\t" $i $(($i+1)) "$ident" &&
+               printf "$zf%02d $zf%02d %s\t" $i $(($i+1)) "$ident" &&
                if test $i = 75; then
                        for j in $(test_seq 1 89); do
                                printf X
@@ -329,7 +329,7 @@ test_expect_success 'parsing reverse reflogs at BUFSIZ boundaries' '
                printf "\n"
        done >.git/logs/refs/heads/reflogskip &&
        git rev-parse reflogskip@{73} >actual &&
-       echo ${z38}03 >expect &&
+       echo ${zf}03 >expect &&
        test_cmp expect actual
 '
 
index 0f268a36642760906b59bc9a8db28a29fcb962fa..b36e0528d07b0e50677c4e487d7b6bd64f79b4fe 100755 (executable)
@@ -9,6 +9,7 @@ test_description='git fsck random collection of tests
 . ./test-lib.sh
 
 test_expect_success setup '
+       test_oid_init &&
        git config gc.auto 0 &&
        git config i18n.commitencoding ISO-8859-1 &&
        test_commit A fileA one &&
@@ -54,8 +55,8 @@ test_expect_success 'setup: helpers for corruption tests' '
 
 test_expect_success 'object with bad sha1' '
        sha=$(echo blob | git hash-object -w --stdin) &&
-       old=$(echo $sha | sed "s+^..+&/+") &&
-       new=$(dirname $old)/ffffffffffffffffffffffffffffffffffffff &&
+       old=$(test_oid_to_path "$sha") &&
+       new=$(dirname $old)/$(test_oid ff_2) &&
        sha="$(dirname $new)$(basename $new)" &&
        mv .git/objects/$old .git/objects/$new &&
        test_when_finished "remove_object $sha" &&
@@ -84,7 +85,7 @@ test_expect_success 'branch pointing to non-commit' '
 test_expect_success 'HEAD link pointing at a funny object' '
        test_when_finished "mv .git/SAVED_HEAD .git/HEAD" &&
        mv .git/HEAD .git/SAVED_HEAD &&
-       echo 0000000000000000000000000000000000000000 >.git/HEAD &&
+       echo $ZERO_OID >.git/HEAD &&
        # avoid corrupt/broken HEAD from interfering with repo discovery
        test_must_fail env GIT_DIR=.git git fsck 2>out &&
        cat out &&
@@ -244,10 +245,16 @@ test_expect_success 'tree object with duplicate entries' '
 '
 
 test_expect_success 'unparseable tree object' '
+       test_oid_cache <<-\EOF &&
+       junk sha1:twenty-bytes-of-junk
+       junk sha256:twenty-bytes-of-junk-twelve-more
+       EOF
+
        test_when_finished "git update-ref -d refs/heads/wrong" &&
        test_when_finished "remove_object \$tree_sha1" &&
        test_when_finished "remove_object \$commit_sha1" &&
-       tree_sha1=$(printf "100644 \0twenty-bytes-of-junk" | git hash-object -t tree --stdin -w --literally) &&
+       junk=$(test_oid junk) &&
+       tree_sha1=$(printf "100644 \0$junk" | git hash-object -t tree --stdin -w --literally) &&
        commit_sha1=$(git commit-tree $tree_sha1) &&
        git update-ref refs/heads/wrong $commit_sha1 &&
        test_must_fail git fsck 2>out &&
@@ -275,8 +282,9 @@ test_expect_success 'tree entry with type mismatch' '
 '
 
 test_expect_success 'tag pointing to nonexistent' '
-       cat >invalid-tag <<-\EOF &&
-       object ffffffffffffffffffffffffffffffffffffffff
+       badoid=$(test_oid deadbeef) &&
+       cat >invalid-tag <<-EOF &&
+       object $badoid
        type commit
        tag invalid
        tagger T A Gger <tagger@example.com> 1234567890 -0000
@@ -386,8 +394,8 @@ test_expect_success 'rev-list --verify-objects' '
 
 test_expect_success 'rev-list --verify-objects with bad sha1' '
        sha=$(echo blob | git hash-object -w --stdin) &&
-       old=$(echo $sha | sed "s+^..+&/+") &&
-       new=$(dirname $old)/ffffffffffffffffffffffffffffffffffffff &&
+       old=$(test_oid_to_path $sha) &&
+       new=$(dirname $old)/$(test_oid ff_2) &&
        sha="$(dirname $new)$(basename $new)" &&
        mv .git/objects/$old .git/objects/$new &&
        test_when_finished "remove_object $sha" &&
@@ -402,7 +410,7 @@ test_expect_success 'rev-list --verify-objects with bad sha1' '
 
        test_might_fail git rev-list --verify-objects refs/heads/bogus >/dev/null 2>out &&
        cat out &&
-       test_i18ngrep -q "error: hash mismatch 63ffffffffffffffffffffffffffffffffffffff" out
+       test_i18ngrep -q "error: hash mismatch $(dirname $new)$(test_oid ff_2)" out
 '
 
 test_expect_success 'force fsck to ignore double author' '
@@ -417,13 +425,12 @@ test_expect_success 'force fsck to ignore double author' '
 '
 
 _bz='\0'
-_bz5="$_bz$_bz$_bz$_bz$_bz"
-_bz20="$_bz5$_bz5$_bz5$_bz5"
+_bzoid=$(printf $ZERO_OID | sed -e 's/00/\\0/g')
 
 test_expect_success 'fsck notices blob entry pointing to null sha1' '
        (git init null-blob &&
         cd null-blob &&
-        sha=$(printf "100644 file$_bz$_bz20" |
+        sha=$(printf "100644 file$_bz$_bzoid" |
               git hash-object -w --stdin -t tree) &&
          git fsck 2>out &&
          cat out &&
@@ -434,7 +441,7 @@ test_expect_success 'fsck notices blob entry pointing to null sha1' '
 test_expect_success 'fsck notices submodule entry pointing to null sha1' '
        (git init null-commit &&
         cd null-commit &&
-        sha=$(printf "160000 submodule$_bz$_bz20" |
+        sha=$(printf "160000 submodule$_bz$_bzoid" |
               git hash-object -w --stdin -t tree) &&
          git fsck 2>out &&
          cat out &&
@@ -586,7 +593,7 @@ test_expect_success 'fsck --connectivity-only' '
                # its type. That lets us see that --connectivity-only is
                # not actually looking at the contents, but leaves it
                # free to examine the type if it chooses.
-               empty=.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 &&
+               empty=.git/objects/$(test_oid_to_path $EMPTY_BLOB) &&
                blob=$(echo unrelated | git hash-object -w --stdin) &&
                mv -f $(sha1_file $blob) $empty &&
 
@@ -631,10 +638,12 @@ test_expect_success 'fsck --name-objects' '
 
 test_expect_success 'alternate objects are correctly blamed' '
        test_when_finished "rm -rf alt.git .git/objects/info/alternates" &&
+       name=$(test_oid numeric) &&
+       path=$(test_oid_to_path "$name") &&
        git init --bare alt.git &&
        echo "../../alt.git/objects" >.git/objects/info/alternates &&
-       mkdir alt.git/objects/12 &&
-       >alt.git/objects/12/34567890123456789012345678901234567890 &&
+       mkdir alt.git/objects/$(dirname $path) &&
+       >alt.git/objects/$(dirname $path)/$(basename $path) &&
        test_must_fail git fsck >out 2>&1 &&
        test_i18ngrep alt.git out
 '
index 4f2f84f309cfdfed82f1ec60ed036e22885a69aa..12a556884427b87e8f3d6784ba638a446f6bf7c2 100755 (executable)
@@ -20,6 +20,22 @@ create_non_racy_file () {
        test-tool chmtime =-5 "$1"
 }
 
+test_expect_success 'setup' '
+       test_oid_cache <<-EOF
+       own_v3 sha1:8299b0bcd1ac364e5f1d7768efb62fa2da79a339
+       own_v3 sha256:38a6d2925e3eceec33ad7b34cbff4e0086caa0daf28f31e51f5bd94b4a7af86b
+
+       base_v3 sha1:39d890139ee5356c7ef572216cebcd27aa41f9df
+       base_v3 sha256:c9baeadf905112bf6c17aefbd7d02267afd70ded613c30cafed2d40cb506e1ed
+
+       own_v4 sha1:432ef4b63f32193984f339431fd50ca796493569
+       own_v4 sha256:6738ac6319c25b694afa7bcc313deb182d1a59b68bf7a47b4296de83478c0420
+
+       base_v4 sha1:508851a7f0dfa8691e9f69c7f055865389012491
+       base_v4 sha256:3177d4adfdd4b6904f7e921d91d715a471c0dde7cf6a4bba574927f02b699508
+       EOF
+'
+
 test_expect_success 'enable split index' '
        git config splitIndex.maxPercentChange 100 &&
        git update-index --split-index &&
@@ -29,11 +45,11 @@ test_expect_success 'enable split index' '
        # NEEDSWORK: Stop hard-coding checksums.
        if test "$indexversion" = "4"
        then
-               own=432ef4b63f32193984f339431fd50ca796493569
-               base=508851a7f0dfa8691e9f69c7f055865389012491
+               own=$(test_oid own_v4)
+               base=$(test_oid base_v4)
        else
-               own=8299b0bcd1ac364e5f1d7768efb62fa2da79a339
-               base=39d890139ee5356c7ef572216cebcd27aa41f9df
+               own=$(test_oid own_v3)
+               base=$(test_oid base_v3)
        fi &&
 
        cat >expect <<-EOF &&
@@ -99,17 +115,18 @@ test_expect_success 'enable split index again, "one" now belongs to base index"'
 
 test_expect_success 'modify original file, base index untouched' '
        echo modified | create_non_racy_file one &&
+       file1_blob=$(git hash-object one) &&
        git update-index one &&
        git ls-files --stage >ls-files.actual &&
        cat >ls-files.expect <<-EOF &&
-       100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0       one
+       100644 $file1_blob 0    one
        EOF
        test_cmp ls-files.expect ls-files.actual &&
 
        test-tool dump-split-index .git/index | sed "/^own/d" >actual &&
        q_to_tab >expect <<-EOF &&
        $BASE
-       100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0Q
+       100644 $file1_blob 0Q
        replacements: 0
        deletions:
        EOF
@@ -121,7 +138,7 @@ test_expect_success 'add another file, which stays index' '
        git update-index --add two &&
        git ls-files --stage >ls-files.actual &&
        cat >ls-files.expect <<-EOF &&
-       100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0       one
+       100644 $file1_blob 0    one
        100644 $EMPTY_BLOB 0    two
        EOF
        test_cmp ls-files.expect ls-files.actual &&
@@ -129,7 +146,7 @@ test_expect_success 'add another file, which stays index' '
        test-tool dump-split-index .git/index | sed "/^own/d" >actual &&
        q_to_tab >expect <<-EOF &&
        $BASE
-       100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0Q
+       100644 $file1_blob 0Q
        100644 $EMPTY_BLOB 0    two
        replacements: 0
        deletions:
@@ -141,14 +158,14 @@ test_expect_success 'remove file not in base index' '
        git update-index --force-remove two &&
        git ls-files --stage >ls-files.actual &&
        cat >ls-files.expect <<-EOF &&
-       100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0       one
+       100644 $file1_blob 0    one
        EOF
        test_cmp ls-files.expect ls-files.actual &&
 
        test-tool dump-split-index .git/index | sed "/^own/d" >actual &&
        q_to_tab >expect <<-EOF &&
        $BASE
-       100644 2e0996000b7e9019eabcad29391bf0f5c7702f0b 0Q
+       100644 $file1_blob 0Q
        replacements: 0
        deletions:
        EOF
@@ -237,9 +254,9 @@ test_expect_success 'set core.splitIndex config variable to true' '
        git update-index --add three &&
        git ls-files --stage >ls-files.actual &&
        cat >ls-files.expect <<-EOF &&
-       100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       one
-       100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       three
-       100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       two
+       100644 $EMPTY_BLOB 0    one
+       100644 $EMPTY_BLOB 0    three
+       100644 $EMPTY_BLOB 0    two
        EOF
        test_cmp ls-files.expect ls-files.actual &&
        BASE=$(test-tool dump-split-index .git/index | grep "^base") &&
@@ -257,8 +274,8 @@ test_expect_success 'set core.splitIndex config variable to false' '
        git update-index --force-remove three &&
        git ls-files --stage >ls-files.actual &&
        cat >ls-files.expect <<-EOF &&
-       100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       one
-       100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       two
+       100644 $EMPTY_BLOB 0    one
+       100644 $EMPTY_BLOB 0    two
        EOF
        test_cmp ls-files.expect ls-files.actual &&
        test-tool dump-split-index .git/index | sed "/^own/d" >actual &&
@@ -285,7 +302,7 @@ test_expect_success 'set core.splitIndex config variable back to true' '
        test-tool dump-split-index .git/index | sed "/^own/d" >actual &&
        cat >expect <<-EOF &&
        $BASE
-       100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       four
+       100644 $EMPTY_BLOB 0    four
        replacements:
        deletions:
        EOF
@@ -309,7 +326,7 @@ test_expect_success 'check behavior with splitIndex.maxPercentChange unset' '
        test-tool dump-split-index .git/index | sed "/^own/d" >actual &&
        cat >expect <<-EOF &&
        $BASE
-       100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0       six
+       100644 $EMPTY_BLOB 0    six
        replacements:
        deletions:
        EOF
index 68e54d5c4420092e481ae1324d419f5e5ec0c8ab..5bbe8dcce40160af8ad1d4c5b0d61a404be7552c 100755 (executable)
@@ -247,12 +247,14 @@ test_expect_success 'diff-files/diff-cached shows ita as new/not-new files' '
 test_expect_success '"diff HEAD" includes ita as new files' '
        git reset --hard &&
        echo new >new-ita &&
+       oid=$(git hash-object new-ita) &&
+       oid=$(git rev-parse --short $oid) &&
        git add -N new-ita &&
        git diff HEAD >actual &&
-       cat >expected <<-\EOF &&
+       cat >expected <<-EOF &&
        diff --git a/new-ita b/new-ita
        new file mode 100644
-       index 0000000..3e75765
+       index 0000000..$oid
        --- /dev/null
        +++ b/new-ita
        @@ -0,0 +1 @@
index 602bfd9574350ae7f851d6aa26d978cc919f5c58..37655a237cb783142400364be845bf7279cc2758 100755 (executable)
@@ -94,6 +94,13 @@ check_tar() {
        '
 }
 
+test_expect_success 'setup' '
+       test_oid_cache <<-EOF
+       obj sha1:19f9c8273ec45a8938e6999cb59b3ff66739902a
+       obj sha256:3c666f798798601571f5cec0adb57ce4aba8546875e7693177e0535f34d2c49b
+       EOF
+'
+
 test_expect_success \
     'populate workdir' \
     'mkdir a &&
@@ -369,11 +376,10 @@ test_lazy_prereq TAR_HUGE '
 '
 
 test_expect_success LONG_IS_64BIT 'set up repository with huge blob' '
-       obj_d=19 &&
-       obj_f=f9c8273ec45a8938e6999cb59b3ff66739902a &&
-       obj=${obj_d}${obj_f} &&
-       mkdir -p .git/objects/$obj_d &&
-       cp "$TEST_DIRECTORY"/t5000/$obj .git/objects/$obj_d/$obj_f &&
+       obj=$(test_oid obj) &&
+       path=$(test_oid_to_path $obj) &&
+       mkdir -p .git/objects/$(dirname $path) &&
+       cp "$TEST_DIRECTORY"/t5000/huge-object .git/objects/$path &&
        rm -f .git/index &&
        git update-index --add --cacheinfo 100644,$obj,huge &&
        git commit -m huge
diff --git a/t/t5000/19f9c8273ec45a8938e6999cb59b3ff66739902a b/t/t5000/19f9c8273ec45a8938e6999cb59b3ff66739902a
deleted file mode 100644 (file)
index 5cbe9ec..0000000
Binary files a/t/t5000/19f9c8273ec45a8938e6999cb59b3ff66739902a and /dev/null differ
diff --git a/t/t5000/huge-object b/t/t5000/huge-object
new file mode 100644 (file)
index 0000000..5cbe9ec
Binary files /dev/null and b/t/t5000/huge-object differ
index 49a394bd75dde817700850187966c3d31ae03f17..bdc42e9440cb6c2a37bd2109942f7fe0431d0970 100755 (executable)
@@ -615,6 +615,7 @@ test_expect_success 'broken branch creation' '
        git add missing/MISSING &&
        git commit -m "6(broken): Added file that will be deleted" &&
        git tag BROKEN_HASH6 &&
+       deleted=$(git rev-parse --verify HEAD:missing) &&
        add_line_into_file "7(broken): second line on a broken branch" hello2 &&
        git tag BROKEN_HASH7 &&
        add_line_into_file "8(broken): third line on a broken branch" hello2 &&
@@ -622,12 +623,12 @@ test_expect_success 'broken branch creation' '
        git rm missing/MISSING &&
        git commit -m "9(broken): Remove missing file" &&
        git tag BROKEN_HASH9 &&
-       rm .git/objects/39/f7e61a724187ab767d2e08442d9b6b9dab587d
+       rm .git/objects/$(test_oid_to_path $deleted)
 '
 
 echo "" > expected.ok
 cat > expected.missing-tree.default <<EOF
-fatal: unable to read tree 39f7e61a724187ab767d2e08442d9b6b9dab587d
+fatal: unable to read tree $deleted
 EOF
 
 test_expect_success 'bisect fails if tree is broken on start commit' '
@@ -713,12 +714,12 @@ test_expect_success 'bisect: demonstrate identification of damage boundary' "
 "
 
 cat > expected.bisect-log <<EOF
-# bad: [32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
-# good: [7b7f204a749c3125d5224ed61ea2ae1187ad046f] Add <2: A new day for git> into <hello>.
-git bisect start '32a594a3fdac2d57cf6d02987e30eec68511498c' '7b7f204a749c3125d5224ed61ea2ae1187ad046f'
-# good: [3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
-git bisect good 3de952f2416b6084f557ec417709eac740c6818c
-# first bad commit: [32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
+# bad: [$HASH4] Add <4: Ciao for now> into <hello>.
+# good: [$HASH2] Add <2: A new day for git> into <hello>.
+git bisect start '$HASH4' '$HASH2'
+# good: [$HASH3] Add <3: Another new day for git> into <hello>.
+git bisect good $HASH3
+# first bad commit: [$HASH4] Add <4: Ciao for now> into <hello>.
 EOF
 
 test_expect_success 'bisect log: successful result' '
@@ -731,14 +732,14 @@ test_expect_success 'bisect log: successful result' '
 '
 
 cat > expected.bisect-skip-log <<EOF
-# bad: [32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
-# good: [7b7f204a749c3125d5224ed61ea2ae1187ad046f] Add <2: A new day for git> into <hello>.
-git bisect start '32a594a3fdac2d57cf6d02987e30eec68511498c' '7b7f204a749c3125d5224ed61ea2ae1187ad046f'
-# skip: [3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
-git bisect skip 3de952f2416b6084f557ec417709eac740c6818c
+# bad: [$HASH4] Add <4: Ciao for now> into <hello>.
+# good: [$HASH2] Add <2: A new day for git> into <hello>.
+git bisect start '$HASH4' '$HASH2'
+# skip: [$HASH3] Add <3: Another new day for git> into <hello>.
+git bisect skip $HASH3
 # only skipped commits left to test
-# possible first bad commit: [32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
-# possible first bad commit: [3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
+# possible first bad commit: [$HASH4] Add <4: Ciao for now> into <hello>.
+# possible first bad commit: [$HASH3] Add <3: Another new day for git> into <hello>.
 EOF
 
 test_expect_success 'bisect log: only skip commits left' '
index d4f199391f1abe839e55d5abab8a9476fbfc1d35..48bd3b467d3f32b7a8fda26a7ff04114afde5aa4 100644 (file)
@@ -1430,6 +1430,12 @@ test_oid () {
        eval "printf '%s' \"\${$var}\""
 }
 
+# Insert a slash into an object ID so it can be used to reference a location
+# under ".git/objects".  For example, "deadbeef..." becomes "de/adbeef..".
+test_oid_to_path () {
+       echo "${1%${1#??}}/${1#??}"
+}
+
 # Choose a port number based on the test script's number and store it in
 # the given variable name, unless that variable already contains a number.
 test_set_port () {
index b0cfdc8011c3cf06db89f1fa19c9c2586fcfe4df..77dad5b92048851c622a35d8b34d802fbd0ecac6 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef STATUS_H
 #define STATUS_H
 
-#include <stdio.h>
 #include "string-list.h"
 #include "color.h"
 #include "pathspec.h"
index ec85f5992bd2c5148382eaba73b6c4c51c74dbf2..c7b35a9667f322c151bc8de276654ecd38974aef 100644 (file)
@@ -42,8 +42,6 @@
  */
 
 #include "xinclude.h"
-#include "xtypes.h"
-#include "xdiff.h"
 
 #define MAX_PTR        UINT_MAX
 #define MAX_CNT        UINT_MAX
index f3573d9f00e77ab551b7f109f29356721165ff47..3c5601b602a24cb6cd6e063466369b1a90a14f9f 100644 (file)
@@ -20,8 +20,6 @@
  *
  */
 #include "xinclude.h"
-#include "xtypes.h"
-#include "xdiff.h"
 
 /*
  * The basic idea of patience diff is to find lines that are unique in
index 963e1c58b9049f1b9ee94537171bd3c6cd21680f..cfa6e2220ffd0461ce3293911c86366f6ccb1b05 100644 (file)
  *
  */
 
-#include <limits.h>
-#include <assert.h>
 #include "xinclude.h"
 
 
-
-
 long xdl_bogosqrt(long n) {
        long i;