]> asedeno.scripts.mit.edu Git - git.git/blobdiff - read-cache.c
log --graph --left-right: show left/right information in place of '*'
[git.git] / read-cache.c
index 0382804e7694e9a0e87cc2dc8340187ddeea2d64..8b467f8f415b68db6e6ea83720ce6ae63dedb9e4 100644 (file)
@@ -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;