Merge branch 'sp/refspec-match'
authorJunio C Hamano <gitster@pobox.com>
Wed, 5 Dec 2007 01:07:10 +0000 (17:07 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Dec 2007 01:07:10 +0000 (17:07 -0800)
* sp/refspec-match:
  refactor fetch's ref matching to use refname_match()
  push: use same rules as git-rev-parse to resolve refspecs
  add refname_match()
  push: support pushing HEAD to real branch name

1  2 
builtin-push.c
cache.h
refs.c
remote.c
sha1_name.c
t/t5510-fetch.sh
t/t5516-fetch-push.sh

diff --cc builtin-push.c
Simple merge
diff --cc cache.h
Simple merge
diff --cc refs.c
Simple merge
diff --cc remote.c
index 46e5f04243eb6075a91ac70350555d1aa521f802,48812a713e56bbc74418d2d484ee345b4dc5aa32..3fb0f99b29e7ffd927abf166cfa004c1937aaf60
+++ b/remote.c
@@@ -818,13 -785,13 +796,13 @@@ int branch_merge_matches(struct branch 
  {
        if (!branch || i < 0 || i >= branch->merge_nr)
                return 0;
-       return ref_matches_abbrev(branch->merge[i]->src, refname);
+       return refname_match(branch->merge[i]->src, refname, ref_fetch_rules);
  }
  
 -static struct ref *get_expanded_map(struct ref *remote_refs,
 +static struct ref *get_expanded_map(const struct ref *remote_refs,
                                    const struct refspec *refspec)
  {
 -      struct ref *ref;
 +      const struct ref *ref;
        struct ref *ret = NULL;
        struct ref **tail = &ret;
  
        return ret;
  }
  
 -static struct ref *find_ref_by_name_abbrev(struct ref *refs, const char *name)
 +static const struct ref *find_ref_by_name_abbrev(const struct ref *refs, const char *name)
  {
 -      struct ref *ref;
 +      const struct ref *ref;
        for (ref = refs; ref; ref = ref->next) {
-               if (ref_matches_abbrev(name, ref->name))
+               if (refname_match(name, ref->name, ref_fetch_rules))
                        return ref;
        }
        return NULL;
diff --cc sha1_name.c
Simple merge
Simple merge
Simple merge