Commit 102ff934b46daf842c7e393a017ab35d9449c577

Stefan Sperling 2019-06-11T11:59:18

don't report 'base bumped' status if base is up-to-date

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/lib/worktree.c b/lib/worktree.c
index d541a30..9c8e0f6 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -1476,6 +1476,10 @@ bump_base_commit_id(void *arg, struct got_fileindex_entry *ie)
 	} else if (!got_path_is_child(ie->path, a->path, a->path_len))
 		return NULL;
 
+	if (memcmp(ie->commit_sha1, a->base_commit_id->sha1,
+	    SHA1_DIGEST_LENGTH) == 0)
+		return NULL;
+
 	(*a->progress_cb)(a->progress_arg, GOT_STATUS_BUMP_BASE, ie->path);
 	memcpy(ie->commit_sha1, a->base_commit_id->sha1, SHA1_DIGEST_LENGTH);
 	return NULL;