diff options
author | Erik Faye-Lund <kusmabite@googlemail.com> | 2010-03-03 21:10:21 +0100 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-03-05 02:57:54 -0800 |
commit | a9f979093dabe8b1c7bf8d67863adc378a8bec45 (patch) | |
tree | 4c248a3c1cac9bdbbf709b3cfdc793570de7926d /builtin-hash-object.c | |
parent | Merge branch 'maint' (diff) | |
download | tgif-a9f979093dabe8b1c7bf8d67863adc378a8bec45.tar.xz |
hash-object: support --stdin-paths with --no-filters
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Acked-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-hash-object.c')
-rw-r--r-- | builtin-hash-object.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin-hash-object.c b/builtin-hash-object.c index 6a5f5b5f0e..080af1a01b 100644 --- a/builtin-hash-object.c +++ b/builtin-hash-object.c @@ -33,6 +33,8 @@ static void hash_object(const char *path, const char *type, int write_object, hash_fd(fd, type, write_object, vpath); } +static int no_filters; + static void hash_stdin_paths(const char *type, int write_objects) { struct strbuf buf = STRBUF_INIT, nbuf = STRBUF_INIT; @@ -44,7 +46,8 @@ static void hash_stdin_paths(const char *type, int write_objects) die("line is badly quoted"); strbuf_swap(&buf, &nbuf); } - hash_object(buf.buf, type, write_objects, buf.buf); + hash_object(buf.buf, type, write_objects, + no_filters ? NULL : buf.buf); } strbuf_release(&buf); strbuf_release(&nbuf); @@ -60,7 +63,6 @@ static const char *type; static int write_object; static int hashstdin; static int stdin_paths; -static int no_filters; static const char *vpath; static const struct option hash_object_options[] = { @@ -100,8 +102,6 @@ int cmd_hash_object(int argc, const char **argv, const char *prefix) errstr = "Can't specify files with --stdin-paths"; else if (vpath) errstr = "Can't use --stdin-paths with --path"; - else if (no_filters) - errstr = "Can't use --stdin-paths with --no-filters"; } else { if (hashstdin > 1) |