rebase -m: only call "notes copy" when rewritten exists and is non-empty
PATCH 1/1 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 <[email protected]>
--- git-rebase--merge.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
git-rebase--merge.sh +5 -4
@@ -90,10 +90,11 @@ 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.
Signature · 1 line
1.7.9.2.263.g07763
Quoted 1 line · Andrew Wong
This prevents a shell error complaining rebase-merge/rewritten doesn't exist.
Yeah, the updated logic overall makes more sense, too. "when we have rewritten, then we do these two things" is clear from the text.
Thanks.