diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/fetch.c | 3 | ||||
-rw-r--r-- | builtin/ls-tree.c | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c index fccc9cbea3..6fc5047703 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -148,6 +148,7 @@ static struct ref *get_ref_map(struct transport *transport, int has_merge = branch_has_merge_config(branch); if (remote && (remote->fetch_refspec_nr || + /* Note: has_merge implies non-NULL branch->remote_name */ (has_merge && !strcmp(branch->remote_name, remote->name)))) { for (i = 0; i < remote->fetch_refspec_nr; i++) { get_fetch_map(remote_refs, &remote->fetch[i], &tail, 0); @@ -162,6 +163,8 @@ static struct ref *get_ref_map(struct transport *transport, * if the remote we're fetching from is the same * as given in branch.<name>.remote, we add the * ref given in branch.<name>.merge, too. + * + * Note: has_merge implies non-NULL branch->remote_name */ if (has_merge && !strcmp(branch->remote_name, remote->name)) diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c index dc86b0d9a9..a8187568bf 100644 --- a/builtin/ls-tree.c +++ b/builtin/ls-tree.c @@ -52,6 +52,8 @@ static int show_recursive(const char *base, int baselen, const char *pathname) speclen = strlen(spec); if (speclen <= len) continue; + if (spec[len] && spec[len] != '/') + continue; if (memcmp(pathname, spec, len)) continue; return 1; |