"Johannes Schindelin via GitGitGadget" <[email protected]>
writes:

> +test_expect_failure SHA1 'loose object cache vs re-reading todo list' '
> +     GIT_REBASE_TODO=.git/rebase-merge/git-rebase-todo &&
> +     export GIT_REBASE_TODO &&
> +     write_script append-todo.sh <<-\EOS &&
> +     # For values 5 and 6, this yields SHA-1s with the same first two digits
> +     echo "pick $(git rev-parse --short \
> +             $(printf "%s\\n" \
> +                     "tree $EMPTY_TREE" \
> +                     "author A U Thor <[email protected]> $1 +0000" \
> +                     "committer A U Thor <[email protected]> $1 +0000" \
> +                     "" \
> +                     "$1" |
> +               git hash-object -t commit -w --stdin))" >>$GIT_REBASE_TODO

In the generated append-todo.sh, as the <<EOS above is quoted, we
will see ">>$GIT_REBASE_TODO" literally (not the actual pathname
that begins with .git, but a reference to the variable).  test-lint
may or may not catch it, but redirecting into variable reference
would trigger a(n arguably misguided) warning when run with some
versions of bash.  Quoting

                echo ... >>"$GIT_REBASE_TODO"

would work it around, of course.

> +     shift
> +     test -z "$*" ||
> +     echo "exec $0 $*" >>$GIT_REBASE_TODO

Likewise.

> +     EOS
> +
> +     git rebase HEAD -x "./append-todo.sh 5 6"
> +'
> +
>  test_done

Reply via email to