Merge branch 'sb/perf-without-installed-git' into maint
[gitweb.git] / builtin / remote.c
index cc3c7410f321af91da6af384aadf3dd4db536ce3..181668dedddef9bf79ab91d9740607cf31115a16 100644 (file)
@@ -581,7 +581,6 @@ static int migrate_file(struct remote *remote)
 {
        struct strbuf buf = STRBUF_INIT;
        int i;
-       const char *path = NULL;
 
        strbuf_addf(&buf, "remote.%s.url", remote->name);
        for (i = 0; i < remote->url_nr; i++)
@@ -601,11 +600,9 @@ static int migrate_file(struct remote *remote)
                        return error(_("Could not append '%s' to '%s'"),
                                        remote->fetch_refspec[i], buf.buf);
        if (remote->origin == REMOTE_REMOTES)
-               path = git_path("remotes/%s", remote->name);
+               unlink_or_warn(git_path("remotes/%s", remote->name));
        else if (remote->origin == REMOTE_BRANCHES)
-               path = git_path("branches/%s", remote->name);
-       if (path)
-               unlink_or_warn(path);
+               unlink_or_warn(git_path("branches/%s", remote->name));
        return 0;
 }