Merge branch 'jk/options-cleanup'
authorJunio C Hamano <gitster@pobox.com>
Wed, 10 Feb 2016 22:20:08 +0000 (14:20 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 Feb 2016 22:20:08 +0000 (14:20 -0800)
Various clean-ups to the command line option parsing.

* jk/options-cleanup:
apply, ls-files: simplify "-z" parsing
checkout-index: disallow "--no-stage" option
checkout-index: handle "--no-index" option
checkout-index: handle "--no-prefix" option
checkout-index: simplify "-z" option parsing
give "nbuf" strbuf a more meaningful name

1  2 
builtin/hash-object.c
builtin/ls-files.c
builtin/update-index.c
index ff20395c69780cb5869300af83084d6cac1bbd4d,d3cb4e53453281c60c0ff97a976a2aa621b087a8..f7d3567dd0ce2d75778d6cf011961c0f203432b4
@@@ -58,14 -58,15 +58,15 @@@ static void hash_object(const char *pat
  static void hash_stdin_paths(const char *type, int no_filters, unsigned flags,
                             int literally)
  {
-       struct strbuf buf = STRBUF_INIT, nbuf = STRBUF_INIT;
+       struct strbuf buf = STRBUF_INIT;
+       struct strbuf unquoted = STRBUF_INIT;
  
 -      while (strbuf_getline_lf(&buf, stdin) != EOF) {
 +      while (strbuf_getline(&buf, stdin) != EOF) {
                if (buf.buf[0] == '"') {
-                       strbuf_reset(&nbuf);
-                       if (unquote_c_style(&nbuf, buf.buf, NULL))
+                       strbuf_reset(&unquoted);
+                       if (unquote_c_style(&unquoted, buf.buf, NULL))
                                die("line is badly quoted");
-                       strbuf_swap(&buf, &nbuf);
+                       strbuf_swap(&buf, &unquoted);
                }
                hash_object(buf.buf, type, no_filters ? NULL : buf.buf, flags,
                            literally);
Simple merge
Simple merge