1
0
mirror of https://github.com/git/git.git synced 2024-10-21 08:08:16 +02:00

Merge branch 'nd/maint-hide-checkout-index-from-error' into maint

* nd/maint-hide-checkout-index-from-error:
  entry.c: remove "checkout-index" from error messages
This commit is contained in:
Junio C Hamano 2010-12-14 07:36:00 -08:00
commit 5b57076e58

16
entry.c

@ -106,14 +106,14 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout
case S_IFLNK: case S_IFLNK:
new = read_blob_entry(ce, &size); new = read_blob_entry(ce, &size);
if (!new) if (!new)
return error("git checkout-index: unable to read sha1 file of %s (%s)", return error("unable to read sha1 file of %s (%s)",
path, sha1_to_hex(ce->sha1)); path, sha1_to_hex(ce->sha1));
if (ce_mode_s_ifmt == S_IFLNK && has_symlinks && !to_tempfile) { if (ce_mode_s_ifmt == S_IFLNK && has_symlinks && !to_tempfile) {
ret = symlink(new, path); ret = symlink(new, path);
free(new); free(new);
if (ret) if (ret)
return error("git checkout-index: unable to create symlink %s (%s)", return error("unable to create symlink %s (%s)",
path, strerror(errno)); path, strerror(errno));
break; break;
} }
@ -141,7 +141,7 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout
} }
if (fd < 0) { if (fd < 0) {
free(new); free(new);
return error("git checkout-index: unable to create file %s (%s)", return error("unable to create file %s (%s)",
path, strerror(errno)); path, strerror(errno));
} }
@ -155,16 +155,16 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout
close(fd); close(fd);
free(new); free(new);
if (wrote != size) if (wrote != size)
return error("git checkout-index: unable to write file %s", path); return error("unable to write file %s", path);
break; break;
case S_IFGITLINK: case S_IFGITLINK:
if (to_tempfile) if (to_tempfile)
return error("git checkout-index: cannot create temporary subproject %s", path); return error("cannot create temporary subproject %s", path);
if (mkdir(path, 0777) < 0) if (mkdir(path, 0777) < 0)
return error("git checkout-index: cannot create subproject directory %s", path); return error("cannot create subproject directory %s", path);
break; break;
default: default:
return error("git checkout-index: unknown file mode for %s", path); return error("unknown file mode for %s in index", path);
} }
if (state->refresh_cache) { if (state->refresh_cache) {
@ -211,7 +211,7 @@ int checkout_entry(struct cache_entry *ce, const struct checkout *state, char *t
return 0; return 0;
if (!state->force) { if (!state->force) {
if (!state->quiet) if (!state->quiet)
fprintf(stderr, "git-checkout-index: %s already exists\n", path); fprintf(stderr, "%s already exists, no checkout\n", path);
return -1; return -1;
} }