Commit 78527a0aa079d64a0cbe7def60d689e2fef5beb5

Stefan Sperling 2019-05-22T11:13:53

move a comment to a better place and expand it

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/got/got.c b/got/got.c
index 4b1cab4..032ff72 100644
--- a/got/got.c
+++ b/got/got.c
@@ -2375,7 +2375,6 @@ collect_commit_logmsg(struct got_pathlist_head *commitable_paths, char **logmsg,
 		goto done;
 	}
 
-	/* remove comments */
 	*logmsg = malloc(st2.st_size + 1);
 	if (*logmsg == NULL) {
 		err = got_error_from_errno("malloc");
@@ -2393,7 +2392,7 @@ collect_commit_logmsg(struct got_pathlist_head *commitable_paths, char **logmsg,
 		if (!content_changed && strcmp(buf, initial_content) != 0)
 			content_changed = 1;
 		if (buf[0] == '#' || (len == 0 && buf[0] == '\n'))
-			continue;
+			continue; /* remove comments and leading empty lines */
 		len = strlcat(*logmsg, buf, st2.st_size);
 	}
 	fclose(fp);