We clean up the notes file when exiting. However, actions other than 'edit' have nothing to do with the file, so they should not remove it when done. Signed-off-by: Thomas Rast <trast@xxxxxxxxxxxxxxx> --- git-notes.sh | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/git-notes.sh b/git-notes.sh index 9cbad02..246df65 100755 --- a/git-notes.sh +++ b/git-notes.sh @@ -14,13 +14,13 @@ test -z "$GIT_NOTES_REF" && GIT_NOTES_REF="refs/notes/commits" COMMIT=$(git rev-parse --verify --default HEAD "$@") || die "Invalid commit: $@" -MESSAGE="$GIT_DIR"/new-notes-$COMMIT -trap ' - test -f "$MESSAGE" && rm "$MESSAGE" -' 0 - case "$ACTION" in edit) + MESSAGE="$GIT_DIR"/new-notes-$COMMIT + trap ' + test -f "$MESSAGE" && rm "$MESSAGE" + ' 0 + GIT_NOTES_REF= git log -1 $COMMIT | sed "s/^/#/" > "$MESSAGE" GIT_INDEX_FILE="$MESSAGE".idx -- 1.6.2.rc0.288.g6852b -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html