Skip to content

Commit

Permalink
rebase -m: only call "notes copy" when rewritten exists and is non-empty
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
andrewkww authored and gitster committed Feb 27, 2012
1 parent 39cb644 commit ad687b4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions git-rebase--merge.sh
Expand Up @@ -90,10 +90,13 @@ call_merge () {

finish_rb_merge () {
move_to_original_branch
git notes copy --for-rewrite=rebase < "$state_dir"/rewritten
if test -x "$GIT_DIR"/hooks/post-rewrite &&
test -s "$state_dir"/rewritten; then
"$GIT_DIR"/hooks/post-rewrite rebase < "$state_dir"/rewritten
if test -s "$state_dir"/rewritten
then
git notes copy --for-rewrite=rebase <"$state_dir"/rewritten
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.
Expand Down

0 comments on commit ad687b4

Please sign in to comment.