diff --git a/sunrise-commit b/sunrise-commit index 94ceaf0..49cde82 100755 --- a/sunrise-commit +++ b/sunrise-commit @@ -151,7 +151,7 @@ check_for_changes() { vcs_reset() { if [ ${SC_VCS%-svn} = git ]; then req git reset -q HEAD "${1}" - req git checkout -f "${1}" + git checkout -f "${1}" 2>/dev/null || req rm -f ChangeLog fi } @@ -161,6 +161,10 @@ vcs_status() { fi } +vcs_add() { + ${SC_VCS%-svn} add "$@" +} + vcs_commit() { local msg msg=${1} @@ -294,6 +298,12 @@ main() { if [ ! -f ChangeLog ]; then [ -n "${trivial}" ] && die "Trivial change for an initial commit? You're joking, right?" [ -z "${bns}" ] && die 'Please supply the bug number in the initial commit message!' + if [ ! -f metadata.xml ]; then + req cp ../../skel.metadata.xml metadata.xml + # Output similar to echangelog. + diff -dup /dev/null metadata.xml + req vcs_add metadata.xml + fi fi if [ -z "${trivial}" ]; then