summaryrefslogtreecommitdiff
path: root/git-rebase--merge.sh
diff options
context:
space:
mode:
authorAndrew Wong <andrew.kw.w@gmail.com>2012-02-24 23:31:22 -0500
committerJunio C Hamano <gitster@pobox.com>2012-02-26 16:32:37 -0800
commitad687b447a87efaf61c39075da2ef81b85715186 (patch)
tree7de112331532bc3064f1bb75d33a1d5551f88ac8 /git-rebase--merge.sh
parent39cb6445d9bf5794723bb656499168c3d1b31774 (diff)
downloadgit-ad687b447a87efaf61c39075da2ef81b85715186.tar.gz
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>
Diffstat (limited to 'git-rebase--merge.sh')
-rw-r--r--git-rebase--merge.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/git-rebase--merge.sh b/git-rebase--merge.sh
index 26afc75cc7..dc599077f0 100644
--- a/git-rebase--merge.sh
+++ b/git-rebase--merge.sh
@@ -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.