# BUG: fetch incorrect interpretation of globing patterns in refspecs

1 messages from 2008-07-24 to 2008-07-24. Participants: marc zonzon.
Thread: https://gitlist.dev/t/14653

## marc zonzon, 2008-07-24 07:07

Subject: BUG: fetch incorrect interpretation of globing patterns in refspecs
Message-ID: <71295b5a0807240007k246973abj1897895d0d67bb6c@mail.gmail.com>
URL: https://gitlist.dev/e/71295b5a0807240007k246973abj1897895d0d67bb6c%40mail.gmail.com

```
Helo

I have a repository repo1 with four branches b_first, b_second,
b/third,  b/fourth.
In a repository repo2 I put a remote config with: fetch =
+refs/heads/b/*:refs/remotes/b/* and I expect a fetch to apply to both
b/third and  b/fourth.
But fetch will also catch b_first and b_second even if they don't
match the globing pattern.

I give the full script to reproduce the bug.

Marc

---------------------------------------------------------------------------------
Script started on Thu 24 Jul 2008 08:23:26 AM CEST
$ mkdir repo1
$ cd repo1
$ git init
Initialized empty Git repository in /shared/home/marc/gits/testbed/repo1/.git/
$ echo "master branch" > README
$ git add README
$ git commit README -m'initial commit in master'
Created initial commit 9ebc74c: initial commit in master
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 README
$ git checkout -b  b_first
Switched to a new branch "b_first"
$ echo "branch b_first" >| README
$ git add README
$ git commit README -m'commit in b_first'
Created commit 40d985a: commit in b_first
 1 files changed, 1 insertions(+), 1 deletions(-)
$ git checkout -b b_second
Switched to a new branch "b_second"
$ echo "branch b_second" >| README
$ git add README
$ git commit README -m'commit in b_second'
Created commit 661fe61: commit in b_second
 1 files changed, 1 insertions(+), 1 deletions(-)
$ git checkout -b b/third master
Switched to a new branch "b/third"
$  echo "branch b/third" >| README
$ git add README
$ git commit README -m'commit in b/third'
Created commit 4f02216: commit in b/third
 1 files changed, 1 insertions(+), 1 deletions(-)
$ git checkout -b b/fourth  master
Switched to a new branch "b/fourth"
$ echo "branch b/fourth" >| README
$ git add README
$ git commit README -m'commit in b/fourth'
Created commit 068f9da: commit in b/fourth
 1 files changed, 1 insertions(+), 1 deletions(-)
$ cd ..
$ mkdir repo2
$ cd repo2
$ git init
Initialized empty Git repository in /shared/home/marc/gits/testbed/repo2/.git/
$ git config --add remote.repo1.url ../repo1
$ git config --add remote.repo1.fetch '+refs/heads/b/*:refs/remotes/b/*'
$ git fetch -v repo1
warning: no common commits
remote: Counting objects: 15, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 15 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (15/15), done.
From ../repo1
 * [new branch]      b/fourth   -> b/fourth
 * [new branch]      b/third    -> b/third
 * [new branch]      b_first    -> b_first
 * [new branch]      b_second   -> b_second

```
