path: add a function to check for path suffix
[gitweb.git] / builtin / show-branch.c
index 65f4a4c83c42ec33d5ffe3f1d83d7b5465c0796d..082daeac329d1c9f8f94f91210f854468377ad7a 100644 (file)
@@ -604,6 +604,7 @@ static int parse_reflog_param(const struct option *opt, const char *arg,
 {
        char *ep;
        const char **base = (const char **)opt->value;
+       BUG_ON_OPT_NEG(unset);
        if (!arg)
                arg = "";
        reflog = strtoul(arg, &ep, 10);
@@ -674,7 +675,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
                { OPTION_CALLBACK, 'g', "reflog", &reflog_base, N_("<n>[,<base>]"),
                            N_("show <n> most recent ref-log entries starting at "
                               "base"),
-                           PARSE_OPT_OPTARG,
+                           PARSE_OPT_OPTARG | PARSE_OPT_NONEG,
                            parse_reflog_param },
                OPT_END()
        };
@@ -752,7 +753,8 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
                                /* Ah, that is a date spec... */
                                timestamp_t at;
                                at = approxidate(reflog_base);
-                               read_ref_at(ref, flags, at, -1, &oid, NULL,
+                               read_ref_at(get_main_ref_store(the_repository),
+                                           ref, flags, at, -1, &oid, NULL,
                                            NULL, NULL, &base);
                        }
                }
@@ -764,7 +766,8 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
                        timestamp_t timestamp;
                        int tz;
 
-                       if (read_ref_at(ref, flags, 0, base + i, &oid, &logmsg,
+                       if (read_ref_at(get_main_ref_store(the_repository),
+                                       ref, flags, 0, base + i, &oid, &logmsg,
                                        &timestamp, &tz, NULL)) {
                                reflog = i;
                                break;