aboutsummaryrefslogtreecommitdiff
path: root/builtin-notes.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-notes.c')
-rw-r--r--builtin-notes.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-notes.c b/builtin-notes.c
index 2e45be9de..e5046b98e 100644
--- a/builtin-notes.c
+++ b/builtin-notes.c
@@ -249,6 +249,8 @@ int commit_notes(struct notes_tree *t, const char *msg)
t = &default_notes_tree;
if (!t->initialized || !t->ref || !*t->ref)
die("Cannot commit uninitialized/unreferenced notes tree");
+ if (!t->dirty)
+ return 0; /* don't have to commit an unchanged tree */
/* Prepare commit message and reflog message */
strbuf_addstr(&buf, "notes: "); /* commit message starts at index 7 */