X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=revision.c;h=d41e59b9ccbe30d0589d52d73e0c7bef26394a23;hb=e88856b485cd73dfc1f3ef8d4c5b52a2f557e8c8;hp=e1f9816bd7e2f91b3c23dedd50f0a03d33c33dfc;hpb=1b65a5aa449e2ea99a68f5d13c5521d0dc64dfd1;p=git.git diff --git a/revision.c b/revision.c index e1f9816b..d41e59b9 100644 --- a/revision.c +++ b/revision.c @@ -537,7 +537,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch revs->max_count = atoi(arg + 12); continue; } - /* accept -, like traditilnal "head" */ + /* accept -, like traditional "head" */ if ((*arg == '-') && isdigit(arg[1])) { revs->max_count = atoi(arg + 1); continue; @@ -674,18 +674,16 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch local_flags = UNINTERESTING; arg++; } - if (get_sha1(arg, sha1) < 0) { - struct stat st; + if (get_sha1(arg, sha1)) { int j; if (seen_dashdash || local_flags) die("bad revision '%s'", arg); /* If we didn't have a "--", all filenames must exist */ - for (j = i; j < argc; j++) { - if (lstat(argv[j], &st) < 0) - die("'%s': %s", argv[j], strerror(errno)); - } + for (j = i; j < argc; j++) + verify_filename(revs->prefix, argv[j]); + revs->prune_data = get_pathspec(revs->prefix, argv + i); break; } @@ -695,7 +693,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch if (def && !revs->commits) { unsigned char sha1[20]; struct commit *commit; - if (get_sha1(def, sha1) < 0) + if (get_sha1(def, sha1)) die("bad default revision '%s'", def); commit = get_commit_reference(revs, def, sha1, 0); add_one_commit(commit, revs);