diff options
Diffstat (limited to 'third_party/git/t/lib-rebase.sh')
-rw-r--r-- | third_party/git/t/lib-rebase.sh | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/third_party/git/t/lib-rebase.sh b/third_party/git/t/lib-rebase.sh index b72c051f4761..7ea30e50068b 100644 --- a/third_party/git/t/lib-rebase.sh +++ b/third_party/git/t/lib-rebase.sh @@ -44,10 +44,10 @@ set_fake_editor () { rm -f "$1" echo 'rebase -i script before editing:' cat "$1".tmp - action=\& + action=pick for line in $FAKE_LINES; do case $line in - pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d|label|l|reset|r|merge|m) + pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d) action="$line";; exec_*|x_*|break|b) echo "$line" | sed 's/_/ /g' >> "$1";; @@ -58,12 +58,11 @@ set_fake_editor () { bad) action="badcmd";; fakesha) - test \& != "$action" || action=pick echo "$action XXXXXXX False commit" >> "$1" action=pick;; *) - sed -n "${line}s/^[a-z][a-z]*/$action/p" < "$1".tmp >> "$1" - action=\&;; + sed -n "${line}s/^pick/$action/p" < "$1".tmp >> "$1" + action=pick;; esac done echo 'rebase -i script after editing:' @@ -119,31 +118,3 @@ make_empty () { git commit --allow-empty -m "$1" && git tag "$1" } - -# Call this (inside test_expect_success) at the end of a test file to -# check that no tests have changed editor related environment -# variables or config settings -test_editor_unchanged () { - # We're only interested in exported variables hence 'sh -c' - sh -c 'cat >actual <<-EOF - EDITOR=$EDITOR - FAKE_COMMIT_AMEND=$FAKE_COMMIT_AMEND - FAKE_COMMIT_MESSAGE=$FAKE_COMMIT_MESSAGE - FAKE_LINES=$FAKE_LINES - GIT_EDITOR=$GIT_EDITOR - GIT_SEQUENCE_EDITOR=$GIT_SEQUENCE_EDITOR - core.editor=$(git config core.editor) - sequence.editor=$(git config sequence.editor) - EOF' - cat >expect <<-\EOF - EDITOR=: - FAKE_COMMIT_AMEND= - FAKE_COMMIT_MESSAGE= - FAKE_LINES= - GIT_EDITOR= - GIT_SEQUENCE_EDITOR= - core.editor= - sequence.editor= - EOF - test_cmp expect actual -} |