diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-08-20 12:29:27 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-08-20 13:29:30 -0700 |
commit | e276c26b4b65711c27e3ef37e732d41eeae42094 (patch) | |
tree | ccb0991f57fa881ed80e0c0093844d348b8825bd /t | |
parent | c35539eb10b0ab2a180e523f03ff65dc061bd47e (diff) | |
download | git-e276c26b4b65711c27e3ef37e732d41eeae42094.tar.gz git-e276c26b4b65711c27e3ef37e732d41eeae42094.tar.xz |
for-each-ref: cope with tags with incomplete lines
If you have a tag with a single, incomplete line as its payload, asking
git-for-each-ref for its %(body) element accessed a NULL pointer.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t6300-for-each-ref.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh index a3c8941c7..8ced59321 100755 --- a/t/t6300-for-each-ref.sh +++ b/t/t6300-for-each-ref.sh @@ -262,4 +262,14 @@ for i in "--perl --shell" "-s --python" "--python --tcl" "--tcl --perl"; do " done +test_expect_success 'an unusual tag with an incomplete line' ' + + git tag -m "bogo" bogo && + bogo=$(git cat-file tag bogo) && + bogo=$(printf "%s" "$bogo" | git mktag) && + git tag -f bogo "$bogo" && + git for-each-ref --format "%(body)" refs/tags/bogo + +' + test_done |