diff options
Diffstat (limited to 'builtin-notes.c')
-rw-r--r-- | builtin-notes.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-notes.c b/builtin-notes.c index 2e45be9de7..e5046b98ed 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 */ |