Skip to content

Commit ad687b4

Browse files
andrewkwwgitster
authored andcommitted
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]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 39cb644 commit ad687b4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

git-rebase--merge.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,13 @@ call_merge () {
9090

9191
finish_rb_merge () {
9292
move_to_original_branch
93-
git notes copy --for-rewrite=rebase < "$state_dir"/rewritten
94-
if test -x "$GIT_DIR"/hooks/post-rewrite &&
95-
test -s "$state_dir"/rewritten; then
96-
"$GIT_DIR"/hooks/post-rewrite rebase < "$state_dir"/rewritten
93+
if test -s "$state_dir"/rewritten
94+
then
95+
git notes copy --for-rewrite=rebase <"$state_dir"/rewritten
96+
if test -x "$GIT_DIR"/hooks/post-rewrite
97+
then
98+
"$GIT_DIR"/hooks/post-rewrite rebase <"$state_dir"/rewritten
99+
fi
97100
fi
98101
rm -r "$state_dir"
99102
say All done.

0 commit comments

Comments
 (0)