summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/revision.c b/revision.c
index 9404a05..f24ead5 100644
--- a/revision.c
+++ b/revision.c
@@ -294,9 +294,8 @@ static struct commit *handle_commit(struct rev_info *revs,
/*
* We'll handle the tagged object by looping or dropping
* through to the non-tag handlers below. Do not
- * propagate data from the tag's pending entry.
+ * propagate path data from the tag's pending entry.
*/
- name = "";
path = NULL;
mode = 0;
}
@@ -1636,10 +1635,7 @@ static void append_prune_data(struct cmdline_pathspec *prune, const char **av)
static void read_pathspec_from_stdin(struct rev_info *revs, struct strbuf *sb,
struct cmdline_pathspec *prune)
{
- while (strbuf_getwholeline(sb, stdin, '\n') != EOF) {
- int len = sb->len;
- if (len && sb->buf[len - 1] == '\n')
- sb->buf[--len] = '\0';
+ while (strbuf_getline(sb, stdin) != EOF) {
ALLOC_GROW(prune->path, prune->nr + 1, prune->alloc);
prune->path[prune->nr++] = xstrdup(sb->buf);
}
@@ -1656,10 +1652,8 @@ static void read_revisions_from_stdin(struct rev_info *revs,
warn_on_object_refname_ambiguity = 0;
strbuf_init(&sb, 1000);
- while (strbuf_getwholeline(&sb, stdin, '\n') != EOF) {
+ while (strbuf_getline(&sb, stdin) != EOF) {
int len = sb.len;
- if (len && sb.buf[len - 1] == '\n')
- sb.buf[--len] = '\0';
if (!len)
break;
if (sb.buf[0] == '-') {
@@ -2050,7 +2044,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
} else if (!strcmp(arg, "--ignore-missing")) {
revs->ignore_missing = 1;
} else {
- int opts = diff_opt_parse(&revs->diffopt, argv, argc);
+ int opts = diff_opt_parse(&revs->diffopt, argv, argc, revs->prefix);
if (!opts)
unkv[(*unkc)++] = arg;
return opts;