X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-show-branch.c;h=18786f88e3252dbd46d88014f2f35205c53d5200;hb=5a990e45f920b50aa6b81823120223fb50f56d97;hp=82f75b72dea1a5e6c620003d5c0c4c414dfe42e3;hpb=f789f829933664dc4c3b0af7f1e2c5e37fc8621e;p=git.git diff --git a/builtin-show-branch.c b/builtin-show-branch.c index 82f75b72d..18786f88e 100644 --- a/builtin-show-branch.c +++ b/builtin-show-branch.c @@ -8,9 +8,9 @@ static const char show_branch_usage[] = "git-show-branch [--sparse] [--current] [--all] [--heads] [--tags] [--topo-order] [--more=count | --list | --independent | --merge-base ] [--topics] [...]"; -static int default_num = 0; -static int default_alloc = 0; -static const char **default_arg = NULL; +static int default_num; +static int default_alloc; +static const char **default_arg; #define UNINTERESTING 01 @@ -378,7 +378,7 @@ static int append_head_ref(const char *refname, const unsigned char *sha1) /* If both heads/foo and tags/foo exists, get_sha1 would * get confused. */ - if (get_sha1(refname + ofs, tmp) || memcmp(tmp, sha1, 20)) + if (get_sha1(refname + ofs, tmp) || hashcmp(tmp, sha1)) ofs = 5; return append_ref(refname + ofs, sha1); } @@ -442,7 +442,7 @@ static int rev_is_head(char *head_path, int headlen, char *name, { int namelen; if ((!head_path[0]) || - (head_sha1 && sha1 && memcmp(head_sha1, sha1, 20))) + (head_sha1 && sha1 && hashcmp(head_sha1, sha1))) return 0; namelen = strlen(name); if ((headlen < namelen) || @@ -550,7 +550,7 @@ static int omit_in_dense(struct commit *commit, struct commit **rev, int n) return 0; } -int cmd_show_branch(int ac, const char **av, char **envp) +int cmd_show_branch(int ac, const char **av, const char *prefix) { struct commit *rev[MAX_REVS], *commit; struct commit_list *list = NULL, *seen = NULL; @@ -573,7 +573,6 @@ int cmd_show_branch(int ac, const char **av, char **envp) int topics = 0; int dense = 1; - setup_git_directory(); git_config(git_show_branch_config); /* If nothing is specified, try the default first */