rebase -m: only call "notes copy" when rewritten exists and is non-empty

This prevents a shell error complaining rebase-merge/rewritten doesn't exist.

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Andrew Wong 2012-02-24 23:31:22 -05:00 коммит произвёл Junio C Hamano
Родитель 39cb6445d9
Коммит ad687b447a
1 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -90,11 +90,14 @@ call_merge () {
finish_rb_merge () {
move_to_original_branch
if test -s "$state_dir"/rewritten
then
git notes copy --for-rewrite=rebase <"$state_dir"/rewritten
if test -x "$GIT_DIR"/hooks/post-rewrite &&
test -s "$state_dir"/rewritten; then
if test -x "$GIT_DIR"/hooks/post-rewrite
then
"$GIT_DIR"/hooks/post-rewrite rebase <"$state_dir"/rewritten
fi
fi
rm -r "$state_dir"
say All done.
}