parse_cmd_verify(): copy old_sha1 instead of evaluating <oldvalue> twice
[gitweb.git] / contrib / examples / builtin-fetch--tool.c
index 0d54aa7061e780dd0000b8c2a48e266ad5b8ce53..ee1916641e46c1adfaac31e27c78c11b023d6ffa 100644 (file)
@@ -31,7 +31,8 @@ static int update_ref_env(const char *action,
                rla = "(reflog update)";
        if (snprintf(msg, sizeof(msg), "%s: %s", rla, action) >= sizeof(msg))
                warning("reflog message too long: %.*s...", 50, msg);
-       return update_ref(msg, refname, sha1, oldval, 0, QUIET_ON_ERR);
+       return update_ref(msg, refname, sha1, oldval, 0,
+                         UPDATE_REFS_QUIET_ON_ERR);
 }
 
 static int update_local_ref(const char *name,
@@ -96,7 +97,7 @@ static int update_local_ref(const char *name,
        strcpy(oldh, find_unique_abbrev(current->object.sha1, DEFAULT_ABBREV));
        strcpy(newh, find_unique_abbrev(sha1_new, DEFAULT_ABBREV));
 
-       if (in_merge_bases(current, &updated, 1)) {
+       if (in_merge_bases(current, updated)) {
                fprintf(stderr, "* %s: fast-forward to %s\n",
                        name, note);
                fprintf(stderr, "  old..new: %s..%s\n", oldh, newh);