rebase: move `reset_head()` into a better spot
[gitweb.git] / branch.c
index 6a35dd31f2a9c9171a866c66f65cbb30e2e511a8..776f55fc66fb7d782f30b05ca9bdff4a55028f49 100644 (file)
--- a/branch.c
+++ b/branch.c
@@ -25,9 +25,7 @@ static int find_tracked_branch(struct remote *remote, void *priv)
                        tracking->remote = remote->name;
                } else {
                        free(tracking->spec.src);
-                       if (tracking->src) {
-                               FREE_AND_NULL(tracking->src);
-                       }
+                       FREE_AND_NULL(tracking->src);
                }
                tracking->spec.src = NULL;
        }
@@ -302,7 +300,7 @@ void create_branch(const char *name, const char *start_name,
                break;
        }
 
-       if ((commit = lookup_commit_reference(&oid)) == NULL)
+       if ((commit = lookup_commit_reference(the_repository, &oid)) == NULL)
                die(_("Not a valid branch point: '%s'."), start_name);
        oidcpy(&oid, &commit->object.oid);