summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2008-05-12 17:57:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-05-13 03:54:46 (GMT)
commit960b8ad1b1824b1b82c2b09a000c2119f97633a0 (patch)
tree40cd788ff264c6c81cab6d792068db419b1a7ca1 /read-cache.c
parent64c0d71ce91696dfe5beb4b51e3233e56c857290 (diff)
downloadgit-960b8ad1b1824b1b82c2b09a000c2119f97633a0.zip
git-960b8ad1b1824b1b82c2b09a000c2119f97633a0.tar.gz
git-960b8ad1b1824b1b82c2b09a000c2119f97633a0.tar.bz2
Make the exit code of add_file_to_index actually useful
Update the programs which used the function (as add_file_to_cache). Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/read-cache.c b/read-cache.c
index 0382804..8b467f8 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -470,7 +470,7 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st,
unsigned ce_option = CE_MATCH_IGNORE_VALID|CE_MATCH_RACY_IS_DIRTY;
if (!S_ISREG(st_mode) && !S_ISLNK(st_mode) && !S_ISDIR(st_mode))
- die("%s: can only add regular files, symbolic links or git-directories", path);
+ return error("%s: can only add regular files, symbolic links or git-directories", path);
namelen = strlen(path);
if (S_ISDIR(st_mode)) {
@@ -505,12 +505,12 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st,
return 0;
}
if (index_path(ce->sha1, path, st, 1))
- die("unable to index file %s", path);
+ return error("unable to index file %s", path);
if (ignore_case && alias && different_name(ce, alias))
ce = create_alias_ce(ce, alias);
ce->ce_flags |= CE_ADDED;
if (add_index_entry(istate, ce, ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE))
- die("unable to add %s to index",path);
+ return error("unable to add %s to index",path);
if (verbose)
printf("add '%s'\n", path);
return 0;