for (i = 0; i < list->nr; i++) {
struct stat st;
struct string_list_item *p = &(list->items[i]);
+ int pos = index_name_pos(&the_index, p->string, strlen(p->string));
+ struct cache_entry *ce = pos < 0 ? NULL : active_cache[pos];
+
+ if (ce && ce_skip_worktree(ce))
+ continue;
if (!lstat(p->string, &st)) {
if (add_to_cache(p->string, &st, 0))
if (isatty(0))
fprintf(stderr, "(reading log message from standard input)\n");
if (strbuf_read(&sb, 0, 0) < 0)
- die("could not read log from standard input");
+ die_errno("could not read log from standard input");
hook_arg1 = "message";
} else if (logfile) {
if (strbuf_read_file(&sb, logfile, 0) < 0)
/* Finally, get the commit message */
strbuf_reset(&sb);
if (strbuf_read_file(&sb, git_path(commit_editmsg), 0) < 0) {
+ int saved_errno = errno;
rollback_index_files();
- die("could not read commit message");
+ die("could not read commit message: %s", strerror(saved_errno));
}
/* Truncate the message just before the diff, if any. */