File: 0007-subject-empty

package info (click to toggle)
git-publish 1.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 200 kB
  • sloc: python: 861; sh: 281; makefile: 5
file content (34 lines) | stat: -rwxr-xr-x 872 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
source "$TESTS_DIR/functions.sh"

msgfile="$TEST_DIR/message"

cat >"$msgfile" <<EOF
123456789 123456789 123456789 123456789 123456789 123456789

This is the description.
EOF

# Copy out the cover letter before git-send-email(1) is invoked
hookfile=".git/hooks/pre-publish-send-email"
coverfile="$TEST_DIR/0000-cover-letter-patch"
cat >"$hookfile" <<EOF
#!/bin/bash
cp "\$1/0000-cover-letter.patch" "$coverfile"
exit 0
EOF
chmod 755 "$hookfile"

git checkout -q -b mybranch

GIT_EDITOR="cp $msgfile" git-publish --no-inspect-emails \
  --to somebody@example.com \
  -b HEAD^ \
  --cover-letter \
  --subject-prefix="PATCH" || :

echo -ne \
    'Subject: [PATCH 0/1] 123456789 123456789 123456789 123456789 123456789 123456789\n' \
    >"$TEST_DIR/expected"
grep '^Subject:' "$coverfile" >"$TEST_DIR/found"
assert diff -u "$TEST_DIR/expected" "$TEST_DIR/found"