t: switch "branch -l" to "branch --create-reflog"
[gitweb.git] / refspec.c
index c59a4ccf1e5d689b6f9cff00ee695a7ec4e40870..78edc48ae8eebcfdbfd87172e7ef4ead6c3fff85 100644 (file)
--- a/refspec.c
+++ b/refspec.c
@@ -49,6 +49,8 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet
                size_t rlen = strlen(++rhs);
                is_glob = (1 <= rlen && strchr(rhs, '*'));
                item->dst = xstrndup(rhs, rlen);
+       } else {
+               item->dst = NULL;
        }
 
        llen = (rhs ? (rhs - lhs - 1) : strlen(lhs));
@@ -202,6 +204,8 @@ void refspec_ref_prefixes(const struct refspec *rs,
                const struct refspec_item *item = &rs->items[i];
                const char *prefix = NULL;
 
+               if (item->exact_sha1)
+                       continue;
                if (rs->fetch == REFSPEC_FETCH)
                        prefix = item->src;
                else if (item->dst)