Support for initial commits.
'git checkout' can fail when file is not in index, thus we should fallback to removing the file. Support adding metadata.xml like old sunrise-commit did.
This commit is contained in:
parent
92ead735d0
commit
80434064dc
@ -151,7 +151,7 @@ check_for_changes() {
|
|||||||
vcs_reset() {
|
vcs_reset() {
|
||||||
if [ ${SC_VCS%-svn} = git ]; then
|
if [ ${SC_VCS%-svn} = git ]; then
|
||||||
req git reset -q HEAD "${1}"
|
req git reset -q HEAD "${1}"
|
||||||
req git checkout -f "${1}"
|
git checkout -f "${1}" 2>/dev/null || req rm -f ChangeLog
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,6 +161,10 @@ vcs_status() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vcs_add() {
|
||||||
|
${SC_VCS%-svn} add "$@"
|
||||||
|
}
|
||||||
|
|
||||||
vcs_commit() {
|
vcs_commit() {
|
||||||
local msg
|
local msg
|
||||||
msg=${1}
|
msg=${1}
|
||||||
@ -294,6 +298,12 @@ main() {
|
|||||||
if [ ! -f ChangeLog ]; then
|
if [ ! -f ChangeLog ]; then
|
||||||
[ -n "${trivial}" ] && die "Trivial change for an initial commit? You're joking, right?"
|
[ -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!'
|
[ -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
|
fi
|
||||||
|
|
||||||
if [ -z "${trivial}" ]; then
|
if [ -z "${trivial}" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user