Merge branch 'bd/readme.markdown-more'
authorJunio C Hamano <gitster@pobox.com>
Fri, 3 Jun 2016 21:38:02 +0000 (14:38 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 3 Jun 2016 21:38:02 +0000 (14:38 -0700)
The mark-up in the top-level README.md file has been updated to
typeset CLI command names differently from the body text.

* bd/readme.markdown-more:
README.md: format CLI commands with code syntax

13 files changed:
Documentation/Makefile
Documentation/RelNotes/2.8.4.txt
Documentation/RelNotes/2.9.0.txt
Documentation/git-cherry-pick.txt
Documentation/git-send-email.txt
GIT-VERSION-GEN
Makefile
builtin/cat-file.c
fast-import.c
git-rebase--interactive.sh
t/perf/perf-lib.sh
t/t1500-rev-parse.sh
t/t9300-fast-import.sh
index f6e288bc634cc9a7b231cac0a237a7770efd098f..35c1385ef7e4e5baa822e7dc75b4fc2822aea85f 100644 (file)
@@ -146,7 +146,7 @@ else
        ASCIIDOC_EXTRA += -a git-asciidoc-no-roff
        endif
 endif
-ifdef MAN_BOLD_LITERAL
+ifndef NO_MAN_BOLD_LITERAL
 XMLTO_EXTRA += -m manpage-bold-literal.xsl
 endif
 ifdef DOCBOOK_SUPPRESS_SP
index 6005548fd69909a5a469ccaf2f7bd939d3036184..8d484b170ac7c96cfa1366d0f569ea1e2065cabe 100644 (file)
@@ -24,4 +24,32 @@ Fixes since v2.8.3
  * Many 'linkgit:<git documentation page>' references were broken,
    which are all fixed with this.
 
+ * "git describe --contains" often made a hard-to-justify choice of
+   tag to give name to a given commit, because it tried to come up
+   with a name with smallest number of hops from a tag, causing an old
+   commit whose close descendant that is recently tagged were not
+   described with respect to an old tag but with a newer tag.  It did
+   not help that its computation of "hop" count was further tweaked to
+   penalize being on a side branch of a merge.  The logic has been
+   updated to favor using the tag with the oldest tagger date, which
+   is a lot easier to explain to the end users: "We describe a commit
+   in terms of the (chronologically) oldest tag that contains the
+   commit."
+
+ * Running tests with '-x' option to trace the individual command
+   executions is a useful way to debug test scripts, but some tests
+   that capture the standard error stream and check what the command
+   said can be broken with the trace output mixed in.  When running
+   our tests under "bash", however, we can redirect the trace output
+   to another file descriptor to keep the standard error of programs
+   being tested intact.
+
+ * "http.cookieFile" configuration variable clearly wants a pathname,
+   but we forgot to treat it as such by e.g. applying tilde expansion.
+
+ * When de-initialising all submodules, "git submodule deinit" gave a
+   faulty recommendation to use "git submodule deinit .", which would
+   result in a strange error message in a pathological corner case.
+   This has been corrected to suggest "submodule deinit --all" instead.
+
 Also contains other minor documentation updates and code clean-ups.
index 1bfcce06c591b244616ed90e9e8af366a7705f13..9b8fdc50f6d1bd5c1820083591c4f822398c90c7 100644 (file)
@@ -1,12 +1,12 @@
 Git 2.9 Release Notes
 =====================
 
-Backward compatibility note
----------------------------
+Backward compatibility notes
+----------------------------
 
 The end-user facing Porcelain level commands in the "git diff" and
-"git log" by default enables the rename detection; you can still use
-"diff.renames" configuration variable to disable this.
+"git log" family by default enable the rename detection; you can still
+use "diff.renames" configuration variable to disable this.
 
 Merging two branches that have no common ancestor with "git merge" is
 by default forbidden now to prevent creating such an unusual merge by
@@ -30,8 +30,8 @@ UI, Workflows & Features
 
  * Comes with git-multimail 1.3.1 (in contrib/).
 
- * The end-user facing Porcelain level commands like "diff" and "log"
-   now enables the rename detection by default.
+ * The end-user facing commands like "git diff" and "git log"
+   now enable the rename detection by default.
 
  * The credential.helper configuration variable is cumulative and
    there is no good way to override it from the command line.  As
@@ -39,7 +39,7 @@ UI, Workflows & Features
    as the signal to clear the values specified in various files.
 
  * A new "interactive.diffFilter" configuration can be used to
-   customize the diff shown in "git add -i" session.
+   customize the diff shown in "git add -i" sessions.
 
  * "git p4" now allows P4 author names to be mapped to Git author
    names.
@@ -64,7 +64,7 @@ UI, Workflows & Features
    to be used in a rare event that merges histories of two projects
    that started their lives independently.
 
- * "git pull" has been taught to pass --allow-unrelated-histories
+ * "git pull" has been taught to pass the "--allow-unrelated-histories"
    option to underlying "git merge".
 
  * "git apply -v" learned to report paths in the patch that were
@@ -87,7 +87,7 @@ UI, Workflows & Features
 
  * When "git log" shows the log message indented by 4-spaces, the
    remainder of a line after a HT does not align in the way the author
-   originally intended.  The command now expands tabs by default in
+   originally intended.  The command now expands tabs by default to help
    such a case, and allows the users to override it with a new option,
    "--no-expand-tabs".
 
@@ -97,13 +97,12 @@ UI, Workflows & Features
  * "git rerere" can encounter two or more files with the same conflict
    signature that have to be resolved in different ways, but there was
    no way to record these separate resolutions.
-   (merge d9d501b068 jc/rerere-multi later to maint).
 
  * "git p4" learned to record P4 jobs in Git commit that imports from
    the history in Perforce.
 
  * "git describe --contains" often made a hard-to-justify choice of
-   tag to give name to a given commit, because it tried to come up
+   tag to name a given commit, because it tried to come up
    with a name with smallest number of hops from a tag, causing an old
    commit whose close descendant that is recently tagged were not
    described with respect to an old tag but with a newer tag.  It did
@@ -115,14 +114,14 @@ UI, Workflows & Features
    commit."
    (merge 7550424 js/name-rev-use-oldest-ref later to maint).
 
- * "git clone" learned "--shallow-submodules" option.
+ * "git clone" learned the "--shallow-submodules" option.
 
  * HTTP transport clients learned to throw extra HTTP headers at the
    server, specified via http.extraHeader configuration variable.
 
  * Patch output from "git diff" and friends has been tweaked to be
    more readable by using a blank line as a strong hint that the
-   contents before and after it belong to a logically separate unit.
+   contents before and after it belong to logically separate units.
 
  * A new configuration variable core.hooksPath allows customizing
    where the hook directory is.
@@ -147,12 +146,13 @@ UI, Workflows & Features
    (public, well-known) commit the original series was built on in
    its output.
 
- * "git commit" learned to pay attention to "commit.verbose"
-   configuration variable and act as if "--verbose" option was
-   given from the command line.
+ * "git commit" learned to pay attention to the "commit.verbose"
+   configuration variable and act as if the "--verbose" option
+   was given from the command line.
 
- * Give hints to GMail users with two-factor auth enabled that
-   they need app-specific-password when using send-email.
+ * Updated documentation gives hints to GMail users with two-factor
+   auth enabled that they need app-specific-password when using
+   "git send-email".
 
 
 Performance, Internal Implementation, Development Support etc.
@@ -174,7 +174,8 @@ Performance, Internal Implementation, Development Support etc.
 
  * A major part of "git submodule update" has been ported to C to take
    advantage of the recently added framework to run download tasks in
-   parallel.
+   parallel.  Other updates to "git submodule" that move pieces of
+   logic to C continues.
 
  * Rename bunch of tests on "git clone" for better organization.
 
@@ -188,16 +189,15 @@ Performance, Internal Implementation, Development Support etc.
    do not attempt to look into refs/* when we know we do not have a
    Git repository.
 
- * Code restructuring around the "refs" area to prepare for pluggable
+ * Code restructuring around the "refs" API to prepare for pluggable
    refs backends.
 
- * Sources to many test helper binaries (and the generated helpers)
+ * Sources to many test helper binaries and the generated helpers
    have been moved to t/helper/ subdirectory to reduce clutter at the
    top level of the tree.
 
  * Unify internal logic between "git tag -v" and "git verify-tag"
    commands by making one directly call into the other.
-   (merge bef234b st/verify-tag later to maint).
 
  * "merge-recursive" strategy incorrectly checked if a path that is
    involved in its internal merge exists in the working tree.
@@ -209,9 +209,7 @@ Performance, Internal Implementation, Development Support etc.
  * As nobody maintains our in-tree git.spec.in and distros use their
    own spec file, we stopped pretending that we support "make rpm".
 
- * Move from unsigned char[20] to struct object_id continues.
-
- * Update of "git submodule" to move pieces of logic to C continues.
+ * Move from "unsigned char[20]" to "struct object_id" continues.
 
  * The code for warning_errno/die_errno has been refactored and a new
    error_errno() reporting helper is introduced.
@@ -230,18 +228,25 @@ Performance, Internal Implementation, Development Support etc.
    test-parse-options program so that a caller can tell what it
    expects in its output, so that these repetitions can be cleaned up.
 
- * Add perf test for "rebase -i"
+ * Add perf test for "rebase -i".
 
  * Common mistakes when writing gitlink: in our documentation are
    found by "make check-docs".
 
  * t9xxx series has been updated primarily for readability, while
-   fixing small bugs in it.  A few scripted Porcelains have also been
-   updated to fix possible bugs around their use of "test -z" and
-   "test -n".
+   fixing small bugs in it.  A few scripted Porcelain commands have
+   also been updated to fix possible bugs around their use of
+   "test -z" and "test -n".
 
  * CI test was taught to run git-svn tests.
 
+ * "git cat-file --batch-all" has been sped up, by taking advantage
+   of the fact that it does not have to read a list of objects, in two
+   ways.
+
+ * test updates to make it more readable and maintainable.
+   (merge e6273f4 es/t1500-modernize later to maint).
+
 
 Also contains various documentation updates and code clean-ups.
 
@@ -329,11 +334,11 @@ notes for details).
  * Support for CRAM-MD5 authentication method in "git imap-send" did
    not work well.
 
- * Upcoming OpenSSL 1.1.0 will break compilation b updating a few APIs
-   we use in imap-send, which has been adjusted for the change.
+ * Upcoming OpenSSL 1.1.0 will break compilation by updating a few API
+   elements we use in imap-send, which has been adjusted for the change.
 
  * The socks5:// proxy support added back in 2.6.4 days was not aware
-   that socks5h:// proxies behave differently.
+   that socks5h:// proxies behave differently from socks5:// proxies.
 
  * "git config" had a codepath that tried to pass a NULL to
    printf("%s"), which nobody seems to have noticed.
@@ -354,12 +359,12 @@ notes for details).
  * When "git merge" notices that the merge can be resolved purely at
    the tree level (without having to merge blobs) and the resulting
    tree happens to already exist in the object store, it forgot to
-   update the index, which lead to an inconsistent state for later
-   operations.
+   update the index, which left an inconsistent state that would
+   break later operations.
 
  * "git submodule" reports the paths of submodules the command
-   recurses into, but this was incorrect when the command was not run
-   from the root level of the superproject.
+   recurses into, but these paths were incorrectly reported when
+   the command was not run from the root level of the superproject.
 
  * The "user.useConfigOnly" configuration variable makes it an error
    if users do not explicitly set user.name and user.email.  However,
@@ -391,7 +396,6 @@ notes for details).
  * "git rebase -m" could be asked to rebase an entire branch starting
    from the root, but failed by assuming that there always is a parent
    commit to the first commit on the branch.
-   (merge 79f4344 bw/rebase-merge-entire-branch later to maint).
 
  * Fix a broken "p4 lfs" test.
 
@@ -417,7 +421,6 @@ notes for details).
    the configuration variable.  This will stop requiring the users to
    sign commit objects used internally as an implementation detail of
    "git stash".
-   (merge 6694856 jc/commit-tree-ignore-commit-gpgsign later to maint).
 
  * "http.cookieFile" configuration variable clearly wants a pathname,
    but we forgot to treat it as such by e.g. applying tilde expansion.
@@ -452,7 +455,7 @@ notes for details).
 
  * Portability enhancement for "rebase -i" to help platforms whose
    shell does not like "for i in <empty>" (which is not POSIX-kosher).
-   (merge 8e98b35 jk/rebase-interative-eval-fix later to maint).
+   (merge 8e98b35 jk/rebase-interactive-eval-fix later to maint).
 
  * On Windows, .git and optionally any files whose name starts with a
    dot are now marked as hidden, with a core.hideDotFiles knob to
@@ -486,6 +489,12 @@ notes for details).
    added the feature back in v2.1.0 timeframe.
    (merge 462cbb4 rj/log-decorate-auto later to maint).
 
+ * "git fast-import --export-marks" would overwrite the existing marks
+   file even when it makes a dump from its custom die routine.
+   Prevent it from doing so when we have an import-marks file but
+   haven't finished reading it.
+   (merge f4beed6 fc/fast-import-broken-marks-file later to maint).
+
  * Other minor clean-ups and documentation updates
    (merge 832c0e5 lp/typofixes later to maint).
    (merge f5ee54a sb/z-is-gnutar-ism later to maint).
index 6154e57238143b968b10deacf3ef6fb9d3ef1b86..c104a594afee2dea57db9d9c88b463513558c455 100644 (file)
@@ -128,7 +128,7 @@ effect to your index in a row.
 
 --allow-empty-message::
        By default, cherry-picking a commit with an empty message will fail.
-       This option overrides that behaviour, allowing commits with empty
+       This option overrides that behavior, allowing commits with empty
        messages to be cherry picked.
 
 --keep-redundant-commits::
index edbba3a2ef4ca25827b3a22e7ab2effb50c92165..a88d18604a5b79b27745ffd0552899e7487acebc 100644 (file)
@@ -450,7 +450,7 @@ edit ~/.gitconfig to specify your account settings:
                smtpUser = yourname@gmail.com
                smtpServerPort = 587
 
-If you have multifactor authentication setup on your gmail acocunt, you will
+If you have multifactor authentication setup on your gmail account, you will
 need to generate an app-specific password for use with 'git send-email'. Visit
 https://security.google.com/settings/security/apppasswords to setup an
 app-specific password.  Once setup, you can store it with the credentials
index e3d0bed2a9d5df53e0e57bfa4f0eeedf5b6d96e6..98f2300d3663b551cfa9dd465f2a0e39e0389a55 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=GIT-VERSION-FILE
-DEF_VER=v2.9.0-rc0
+DEF_VER=v2.9.0-rc1
 
 LF='
 '
index 0d59718bf72a8f033f2d2a5be7d260b52039408e..de5a0302565899a90482631e2267f3c413f347d4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -375,13 +375,7 @@ GIT-VERSION-FILE: FORCE
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
 CFLAGS = -g -O2 -Wall
-LDFLAGS =
-ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
-ALL_LDFLAGS = $(LDFLAGS)
-STRIP ?= strip
-
-ifdef DEVELOPER
-CFLAGS += -Werror \
+DEVELOPER_CFLAGS = -Werror \
        -Wdeclaration-after-statement \
        -Wno-format-zero-length \
        -Wold-style-definition \
@@ -390,7 +384,10 @@ CFLAGS += -Werror \
        -Wstrict-prototypes \
        -Wunused \
        -Wvla
-endif
+LDFLAGS =
+ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
+ALL_LDFLAGS = $(LDFLAGS)
+STRIP ?= strip
 
 # Create as necessary, replace existing, make ranlib unneeded.
 ARFLAGS = rcs
@@ -951,6 +948,10 @@ include config.mak.uname
 -include config.mak.autogen
 -include config.mak
 
+ifdef DEVELOPER
+CFLAGS += $(DEVELOPER_CFLAGS)
+endif
+
 ifndef sysconfdir
 ifeq ($(prefix),/usr)
 sysconfdir = /etc
index 54db1184a003897294b6aaa46bc6bf29faa919bc..618103fdeeb7f7b35911ebd12d0d811cc4a5297a 100644 (file)
@@ -154,6 +154,13 @@ struct expand_data {
         * elements above, so you can retrieve the response from there.
         */
        struct object_info info;
+
+       /*
+        * This flag will be true if the requested batch format and options
+        * don't require us to call sha1_object_info, which can then be
+        * optimized out.
+        */
+       unsigned skip_object_info : 1;
 };
 
 static int is_atom(const char *atom, const char *s, int slen)
@@ -258,7 +265,8 @@ static void batch_object_write(const char *obj_name, struct batch_options *opt,
 {
        struct strbuf buf = STRBUF_INIT;
 
-       if (sha1_object_info_extended(data->sha1, &data->info, LOOKUP_REPLACE_OBJECT) < 0) {
+       if (!data->skip_object_info &&
+           sha1_object_info_extended(data->sha1, &data->info, LOOKUP_REPLACE_OBJECT) < 0) {
                printf("%s missing\n", obj_name ? obj_name : sha1_to_hex(data->sha1));
                fflush(stdout);
                return;
@@ -369,6 +377,13 @@ static int batch_objects(struct batch_options *opt)
        strbuf_expand(&buf, opt->format, expand_format, &data);
        data.mark_query = 0;
 
+       if (opt->all_objects) {
+               struct object_info empty;
+               memset(&empty, 0, sizeof(empty));
+               if (!memcmp(&data.info, &empty, sizeof(empty)))
+                       data.skip_object_info = 1;
+       }
+
        /*
         * If we are printing out the object, then always fill in the type,
         * since we will want to decide whether or not to stream.
@@ -489,6 +504,7 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
 
        git_config(git_cat_file_config, NULL);
 
+       batch.buffer_output = -1;
        argc = parse_options(argc, argv, prefix, options, cat_file_usage, 0);
 
        if (opt) {
@@ -512,6 +528,9 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
                usage_with_options(cat_file_usage, options);
        }
 
+       if (batch.buffer_output < 0)
+               batch.buffer_output = batch.all_objects;
+
        if (batch.enabled)
                return batch_objects(&batch);
 
index 83558dcfe3ab442a415accd82ec7503f95f4746e..c504ef752db124e21156be5b92360dbe432e568f 100644 (file)
@@ -329,6 +329,7 @@ static const char *export_marks_file;
 static const char *import_marks_file;
 static int import_marks_file_from_stream;
 static int import_marks_file_ignore_missing;
+static int import_marks_file_done;
 static int relative_marks_paths;
 
 /* Our last blob */
@@ -1802,7 +1803,7 @@ static void dump_marks(void)
        static struct lock_file mark_lock;
        FILE *f;
 
-       if (!export_marks_file)
+       if (!export_marks_file || (import_marks_file && !import_marks_file_done))
                return;
 
        if (hold_lock_file_for_update(&mark_lock, export_marks_file, 0) < 0) {
@@ -1835,7 +1836,7 @@ static void read_marks(void)
        if (f)
                ;
        else if (import_marks_file_ignore_missing && errno == ENOENT)
-               return; /* Marks file does not exist */
+               goto done; /* Marks file does not exist */
        else
                die_errno("cannot read '%s'", import_marks_file);
        while (fgets(line, sizeof(line), f)) {
@@ -1865,6 +1866,8 @@ static void read_marks(void)
                insert_mark(mark, e);
        }
        fclose(f);
+done:
+       import_marks_file_done = 1;
 }
 
 
index 9d2bfb7a16afc10c1a52fe80e718d6199df0e331..6e96abcc3c6b942eed3e8c522f089d823b02a1fa 100644 (file)
@@ -192,7 +192,6 @@ make_patch () {
 die_with_patch () {
        echo "$1" > "$state_dir"/stopped-sha
        make_patch "$1"
-       git rerere
        die "$2"
 }
 
index 5ef17440c0e1e63102adddba958686c28b4e80ec..18c363ea7f384ee625b0efc162dc081f51a3780f 100644 (file)
@@ -84,6 +84,7 @@ test_perf_create_repo_from () {
        objects_dir="$(git -C "$source" rev-parse --git-path objects)"
        mkdir -p "$repo/.git"
        (
+               cd "$source" &&
                { cp -Rl "$objects_dir" "$repo/.git/" 2>/dev/null ||
                        cp -R "$objects_dir" "$repo/.git/"; } &&
                for stuff in "$source_git"/*; do
@@ -94,7 +95,9 @@ test_perf_create_repo_from () {
                                        cp -R "$stuff" "$repo/.git/" || exit 1
                                        ;;
                        esac
-               done &&
+               done
+       ) &&
+       (
                cd "$repo" &&
                git init -q && {
                        test_have_prereq SYMLINKS ||
index 48ee07779d64147c3eb8325a3b3f9579f8ec41d8..038e24c401451d61e9c93fb5c233d132a3d51acd 100755 (executable)
@@ -3,85 +3,88 @@
 test_description='test git rev-parse'
 . ./test-lib.sh
 
-test_rev_parse() {
-       name=$1
-       shift
-
-       test_expect_success "$name: is-bare-repository" \
-       "test '$1' = \"\$(git rev-parse --is-bare-repository)\""
-       shift
-       [ $# -eq 0 ] && return
-
-       test_expect_success "$name: is-inside-git-dir" \
-       "test '$1' = \"\$(git rev-parse --is-inside-git-dir)\""
-       shift
-       [ $# -eq 0 ] && return
+# usage: [options] label is-bare is-inside-git is-inside-work prefix git-dir
+test_rev_parse () {
+       d=
+       bare=
+       gitdir=
+       while :
+       do
+               case "$1" in
+               -C) d="$2"; shift; shift ;;
+               -b) case "$2" in
+                   [tfu]*) bare="$2"; shift; shift ;;
+                   *) error "test_rev_parse: bogus core.bare value '$2'" ;;
+                   esac ;;
+               -g) gitdir="$2"; shift; shift ;;
+               -*) error "test_rev_parse: unrecognized option '$1'" ;;
+               *) break ;;
+               esac
+       done
 
-       test_expect_success "$name: is-inside-work-tree" \
-       "test '$1' = \"\$(git rev-parse --is-inside-work-tree)\""
-       shift
-       [ $# -eq 0 ] && return
-
-       test_expect_success "$name: prefix" \
-       "test '$1' = \"\$(git rev-parse --show-prefix)\""
+       name=$1
        shift
-       [ $# -eq 0 ] && return
 
-       test_expect_success "$name: git-dir" \
-       "test '$1' = \"\$(git rev-parse --git-dir)\""
-       shift
-       [ $# -eq 0 ] && return
+       for o in --is-bare-repository \
+                --is-inside-git-dir \
+                --is-inside-work-tree \
+                --show-prefix \
+                --git-dir
+       do
+               test $# -eq 0 && break
+               expect="$1"
+               test_expect_success "$name: $o" '
+                       if test -n "$gitdir"
+                       then
+                               test_when_finished "unset GIT_DIR" &&
+                               GIT_DIR="$gitdir" &&
+                               export GIT_DIR
+                       fi &&
+
+                       case "$bare" in
+                       t*) test_config ${d:+-C} ${d:+"$d"} core.bare true ;;
+                       f*) test_config ${d:+-C} ${d:+"$d"} core.bare false ;;
+                       u*) test_unconfig ${d:+-C} ${d:+"$d"} core.bare ;;
+                       esac &&
+
+                       echo "$expect" >expect &&
+                       git ${d:+-C} ${d:+"$d"} rev-parse $o >actual &&
+                       test_cmp expect actual
+               '
+               shift
+       done
 }
 
-# label is-bare is-inside-git is-inside-work prefix git-dir
-
 ROOT=$(pwd)
 
+test_expect_success 'setup' '
+       mkdir -p sub/dir work &&
+       cp -R .git repo.git
+'
+
 test_rev_parse toplevel false false true '' .git
 
-cd .git || exit 1
-test_rev_parse .git/ false true false '' .
-cd objects || exit 1
-test_rev_parse .git/objects/ false true false '' "$ROOT/.git"
-cd ../.. || exit 1
+test_rev_parse -C .git .git/ false true false '' .
+test_rev_parse -C .git/objects .git/objects/ false true false '' "$ROOT/.git"
 
-mkdir -p sub/dir || exit 1
-cd sub/dir || exit 1
-test_rev_parse subdirectory false false true sub/dir/ "$ROOT/.git"
-cd ../.. || exit 1
+test_rev_parse -C sub/dir subdirectory false false true sub/dir/ "$ROOT/.git"
 
-git config core.bare true
-test_rev_parse 'core.bare = true' true false false
+test_rev_parse -b t 'core.bare = true' true false false
 
-git config --unset core.bare
-test_rev_parse 'core.bare undefined' false false true
+test_rev_parse -b u 'core.bare undefined' false false true
 
-mkdir work || exit 1
-cd work || exit 1
-GIT_DIR=../.git
-GIT_CONFIG="$(pwd)"/../.git/config
-export GIT_DIR GIT_CONFIG
 
-git config core.bare false
-test_rev_parse 'GIT_DIR=../.git, core.bare = false' false false true ''
+test_rev_parse -C work -g ../.git -b f 'GIT_DIR=../.git, core.bare = false' false false true ''
 
-git config core.bare true
-test_rev_parse 'GIT_DIR=../.git, core.bare = true' true false false ''
+test_rev_parse -C work -g ../.git -b t 'GIT_DIR=../.git, core.bare = true' true false false ''
 
-git config --unset core.bare
-test_rev_parse 'GIT_DIR=../.git, core.bare undefined' false false true ''
+test_rev_parse -C work -g ../.git -b u 'GIT_DIR=../.git, core.bare undefined' false false true ''
 
-mv ../.git ../repo.git || exit 1
-GIT_DIR=../repo.git
-GIT_CONFIG="$(pwd)"/../repo.git/config
 
-git config core.bare false
-test_rev_parse 'GIT_DIR=../repo.git, core.bare = false' false false true ''
+test_rev_parse -C work -g ../repo.git -b f 'GIT_DIR=../repo.git, core.bare = false' false false true ''
 
-git config core.bare true
-test_rev_parse 'GIT_DIR=../repo.git, core.bare = true' true false false ''
+test_rev_parse -C work -g ../repo.git -b t 'GIT_DIR=../repo.git, core.bare = true' true false false ''
 
-git config --unset core.bare
-test_rev_parse 'GIT_DIR=../repo.git, core.bare undefined' false false true ''
+test_rev_parse -C work -g ../repo.git -b u 'GIT_DIR=../repo.git, core.bare undefined' false false true ''
 
 test_done
index 25bb60b2814320b628d3d12af88ee1d394a94217..4bca35c2594bbff4a659e1d6d1dcc5e746956a84 100755 (executable)
@@ -2650,6 +2650,21 @@ test_expect_success 'R: ignore non-git options' '
        git fast-import <input
 '
 
+test_expect_success 'R: corrupt lines do not mess marks file' '
+       rm -f io.marks &&
+       blob=$(echo hi | git hash-object --stdin) &&
+       cat >expect <<-EOF &&
+       :3 0000000000000000000000000000000000000000
+       :1 $blob
+       :2 $blob
+       EOF
+       cp expect io.marks &&
+       test_must_fail git fast-import --import-marks=io.marks --export-marks=io.marks <<-\EOF &&
+
+       EOF
+       test_cmp expect io.marks
+'
+
 ##
 ## R: very large blobs
 ##