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>
maint
Andrew Wong 2012-02-24 23:31:22 -05:00 committed by Junio C Hamano
parent 39cb6445d9
commit ad687b447a
1 changed files with 7 additions and 4 deletions

View File

@ -90,11 +90,14 @@ call_merge () {


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