check-attr: there are only two possible line terminations
[gitweb.git] / builtin / pull.c
index b7bc1fff5e0c05782dbb9e9bf3210248db15c54a..52606a84cebf1421f5378233d1915df5233c8737 100644 (file)
@@ -15,6 +15,7 @@
 #include "dir.h"
 #include "refs.h"
 #include "revision.h"
+#include "tempfile.h"
 #include "lockfile.h"
 
 enum rebase_type {
@@ -65,7 +66,7 @@ static int parse_opt_rebase(const struct option *opt, const char *arg, int unset
 }
 
 static const char * const pull_usage[] = {
-       N_("git pull [options] [<repository> [<refspec>...]]"),
+       N_("git pull [<options>] [<repository> [<refspec>...]]"),
        NULL
 };
 
@@ -111,7 +112,7 @@ static struct option pull_options[] = {
        /* Options passed to git-merge or git-rebase */
        OPT_GROUP(N_("Options related to merging")),
        { OPTION_CALLBACK, 'r', "rebase", &opt_rebase,
-         N_("false|true|preserve"),
+         "false|true|preserve",
          N_("incorporate changes by rebasing rather than merging"),
          PARSE_OPT_OPTARG, parse_opt_rebase },
        OPT_PASSTHRU('n', NULL, &opt_diffstat, NULL,
@@ -377,7 +378,7 @@ static void get_merge_heads(struct sha1_array *merge_heads)
 
        if (!(fp = fopen(filename, "r")))
                die_errno(_("could not open '%s' for reading"), filename);
-       while (strbuf_getline(&sb, fp, '\n') != EOF) {
+       while (strbuf_getline_lf(&sb, fp) != EOF) {
                if (get_sha1_hex(sb.buf, sha1))
                        continue;  /* invalid line: does not start with SHA1 */
                if (starts_with(sb.buf + GIT_SHA1_HEXSZ, "\tnot-for-merge\t"))
@@ -742,7 +743,7 @@ static int get_octopus_merge_base(unsigned char *merge_base,
        if (!result)
                return 1;
 
-       hashcpy(merge_base, result->item->object.sha1);
+       hashcpy(merge_base, result->item->object.oid.hash);
        return 0;
 }