Code

Merge branch 'bw/maint-t8006-sed-incomplete-line'
[git.git] / builtin / replace.c
index fe3a647a36c9a064d32c8bf9d9868da041bd82a2..4a8970e9c95c1e07c1ed919d40f33238dcd05588 100644 (file)
@@ -58,7 +58,7 @@ static int for_each_replace_name(const char **argv, each_replace_name_fn fn)
                        had_error = 1;
                        continue;
                }
-               if (!resolve_ref(ref, sha1, 1, NULL)) {
+               if (read_ref(ref, sha1)) {
                        error("replace ref '%s' not found.", *p);
                        had_error = 1;
                        continue;
@@ -94,10 +94,10 @@ static int replace_object(const char *object_ref, const char *replace_ref,
                     "refs/replace/%s",
                     sha1_to_hex(object)) > sizeof(ref) - 1)
                die("replace ref name too long: %.*s...", 50, ref);
-       if (check_ref_format(ref))
+       if (check_refname_format(ref, 0))
                die("'%s' is not a valid ref name.", ref);
 
-       if (!resolve_ref(ref, prev, 1, NULL))
+       if (read_ref(ref, prev))
                hashclr(prev);
        else if (!force)
                die("replace ref '%s' already exists", ref);