]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sha1-name.c
Merge branch 'pk/subsub-fetch-fix'
[thirdparty/git.git] / sha1-name.c
index a7a9de66c4577540799fad3230c65c9e17fbe583..0b23b86ceb4433ece828e780be180579a77f3fe8 100644 (file)
@@ -809,7 +809,7 @@ static int get_oid_basic(struct repository *r, const char *str, int len,
 
        if (len == r->hash_algo->hexsz && !get_oid_hex(str, oid)) {
                if (warn_ambiguous_refs && warn_on_object_refname_ambiguity) {
-                       refs_found = repo_dwim_ref(r, str, len, &tmp_oid, &real_ref);
+                       refs_found = repo_dwim_ref(r, str, len, &tmp_oid, &real_ref, 0);
                        if (refs_found > 0) {
                                warning(warn_msg, len, str);
                                if (advice_object_name_warning)
@@ -860,11 +860,11 @@ static int get_oid_basic(struct repository *r, const char *str, int len,
 
        if (!len && reflog_len)
                /* allow "@{...}" to mean the current branch reflog */
-               refs_found = repo_dwim_ref(r, "HEAD", 4, oid, &real_ref);
+               refs_found = repo_dwim_ref(r, "HEAD", 4, oid, &real_ref, 0);
        else if (reflog_len)
                refs_found = repo_dwim_log(r, str, len, oid, &real_ref);
        else
-               refs_found = repo_dwim_ref(r, str, len, oid, &real_ref);
+               refs_found = repo_dwim_ref(r, str, len, oid, &real_ref, 0);
 
        if (!refs_found)
                return -1;
@@ -1496,8 +1496,14 @@ static int interpret_branch_mark(struct repository *r,
                branch = branch_get(NULL);
 
        value = get_data(branch, &err);
-       if (!value)
-               die("%s", err.buf);
+       if (!value) {
+               if (options->nonfatal_dangling_mark) {
+                       strbuf_release(&err);
+                       return -1;
+               } else {
+                       die("%s", err.buf);
+               }
+       }
 
        if (!branch_interpret_allowed(value, options->allowed))
                return -1;