git-p4: Unset P4DIFF environment variable when using 'p4 -du diff'
[gitweb.git] / remote.c
index 1f836967588456b03c1390157ca04aad7b8e3eac..f3f7375eea6d8c09e4ab6f561be22b08e545efcb 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -357,7 +357,8 @@ static int handle_config(const char *key, const char *value)
                        remote->fetch_tags = -1;
        } else if (!strcmp(subkey, ".proxy")) {
                remote->http_proxy = xstrdup(value);
-       }
+       } else if (!strcmp(subkey, ".skipdefaultupdate"))
+               remote->skip_default_update = 1;
        return 0;
 }
 
@@ -593,8 +594,7 @@ void free_refs(struct ref *ref)
        struct ref *next;
        while (ref) {
                next = ref->next;
-               if (ref->peer_ref)
-                       free(ref->peer_ref);
+               free(ref->peer_ref);
                free(ref);
                ref = next;
        }
@@ -730,9 +730,17 @@ static int match_explicit(struct ref *src, struct ref *dst,
                errs = 1;
 
        if (!dst_value) {
+               unsigned char sha1[20];
+               int flag;
+
                if (!matched_src)
                        return errs;
-               dst_value = matched_src->name;
+               dst_value = resolve_ref(matched_src->name, sha1, 1, &flag);
+               if (!dst_value ||
+                   ((flag & REF_ISSYMREF) &&
+                    prefixcmp(dst_value, "refs/heads/")))
+                       die("%s cannot be resolved to branch.",
+                           matched_src->name);
        }
 
        switch (count_refspec_match(dst_value, dst, &matched_dst)) {