Skip to content

Commit d43e907

Browse files
pcloudsgitster
authored andcommitted
entry.c: remove "checkout-index" from error messages
Back then when entry.c was part of checkout-index (or checkout-cache at that time [1]). It makes sense to print the command name in error messages. Nowadays entry.c is in libgit and can be used by any commands, printing "git checkout-index: blah" does no more than confusion. The error messages without it still give enough information. [1] 12dccc1 (Make fiel checkout function available to the git library - 2005-06-05) Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 16529f2 commit d43e907

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

entry.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout
106106
case S_IFLNK:
107107
new = read_blob_entry(ce, &size);
108108
if (!new)
109-
return error("git checkout-index: unable to read sha1 file of %s (%s)",
109+
return error("unable to read sha1 file of %s (%s)",
110110
path, sha1_to_hex(ce->sha1));
111111

112112
if (ce_mode_s_ifmt == S_IFLNK && has_symlinks && !to_tempfile) {
113113
ret = symlink(new, path);
114114
free(new);
115115
if (ret)
116-
return error("git checkout-index: unable to create symlink %s (%s)",
116+
return error("unable to create symlink %s (%s)",
117117
path, strerror(errno));
118118
break;
119119
}
@@ -141,7 +141,7 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout
141141
}
142142
if (fd < 0) {
143143
free(new);
144-
return error("git checkout-index: unable to create file %s (%s)",
144+
return error("unable to create file %s (%s)",
145145
path, strerror(errno));
146146
}
147147

@@ -155,16 +155,16 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout
155155
close(fd);
156156
free(new);
157157
if (wrote != size)
158-
return error("git checkout-index: unable to write file %s", path);
158+
return error("unable to write file %s", path);
159159
break;
160160
case S_IFGITLINK:
161161
if (to_tempfile)
162-
return error("git checkout-index: cannot create temporary subproject %s", path);
162+
return error("cannot create temporary subproject %s", path);
163163
if (mkdir(path, 0777) < 0)
164-
return error("git checkout-index: cannot create subproject directory %s", path);
164+
return error("cannot create subproject directory %s", path);
165165
break;
166166
default:
167-
return error("git checkout-index: unknown file mode for %s", path);
167+
return error("unknown file mode for %s in index", path);
168168
}
169169

170170
if (state->refresh_cache) {
@@ -211,7 +211,7 @@ int checkout_entry(struct cache_entry *ce, const struct checkout *state, char *t
211211
return 0;
212212
if (!state->force) {
213213
if (!state->quiet)
214-
fprintf(stderr, "git-checkout-index: %s already exists\n", path);
214+
fprintf(stderr, "%s already exists, no checkout\n", path);
215215
return -1;
216216
}
217217

0 commit comments

Comments
 (0)