Commit 381a3e81 by Stefan

* bugit (bugit_cmd_new): Don't pass binary data through $(..) (bugit#4).

(bugit_cmd_reply): Idem.
(bugit_record_new_name): Don't add empty line in Git script.
parent 59db9bd3
......@@ -580,6 +580,7 @@ bugit_manage_set () { # SET ISSUE [OPERATION] [VALS...]
case $set in *" "* ) user_error "Invalid set name '$set'";; esac
bugit_get_id "$issue"
if [ "" = "$operation" ]; then
bugit_get_branch "$id"
git cat-file -p "$branch:$set" 2>/dev/null |
while read _mode _type _hash name; do
echo "$(bugit_from_filename "$name")"
......@@ -742,8 +743,8 @@ committer $(bugit_author_date)
data 0
from refs/heads/bugit-revmaps^0
$([ "" = "$old" ] || echo "D name/$(bugit_to_filename "$old")/$id")
M 644 inline name/$(bugit_to_filename "$new")/$id
$([ "" = "$old" ] || echo "D name/$(bugit_to_filename "$old")/$id"
echo "M 644 inline name/$(bugit_to_filename "$new")/$id")
data 0
......@@ -948,12 +949,19 @@ ENDDOC
if [ "" = "$usedesc" ]; then
usedesc=$(git config bugit.usedescriptions 2>/dev/null);
fi
git fast-import --quiet <<ENDDOC
(cat <<ENDDOC
commit refs/heads/bugit/$id
author $author $date
committer $committer $date
$(bugit_add_description_cmds "$message" "$usedesc")
$(bugit_add_attachments "$@")
ENDDOC
# WARNING! We used to use a single here-doc passed to "git fast-import"
# with $(...) forms inside, but the $(...) processing messes things up:
# - it strips trailing newlines
# - it drops NUL bytes
# See bugit#4 for an example of the problem.
bugit_add_description_cmds "$message" "$usedesc"
bugit_add_attachments "$@"
cat <<ENDDOC
M 644 inline followers/$author
data 0
......@@ -963,6 +971,7 @@ $name
done
ENDDOC
) | git fast-import --quiet
bugit_record_new_name "$id" "$name"
}
......@@ -1005,16 +1014,19 @@ else echo "Edit the description below"; fi) about BuGit#${number:-$id}
|BUGIT| BuGit assumes this is written in Markdown format.
$(if [ "" != "$editdesc" ]; then bugit_cmd_description "$id"; fi)"
local date="$(date '+%s %z')"
git fast-import --quiet <<ENDDOC
(cat <<ENDDOC
commit refs/heads/bugit/$id
author $author $date
committer $committer $date
$(bugit_add_description_cmds "$message" "$editdesc" \
"from refs/heads/bugit/$id^0")
$(bugit_add_attachments "$@")
ENDDOC
bugit_add_description_cmds "$message" "$editdesc" \
"from refs/heads/bugit/$id^0"
bugit_add_attachments "$@"
cat <<ENDDOC
done
ENDDOC
) | git fast-import --quiet
}
# Debian stable's Git-2.1.4 doesn't yet support --invert-grep!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment