diff options
Diffstat (limited to 'builtin-checkout.c')
-rw-r--r-- | builtin-checkout.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin-checkout.c b/builtin-checkout.c index a3b69d6b94..dc1de06279 100644 --- a/builtin-checkout.c +++ b/builtin-checkout.c @@ -361,8 +361,10 @@ struct branch_info { static void setup_branch_path(struct branch_info *branch) { struct strbuf buf = STRBUF_INIT; + int ret; - if (!interpret_nth_last_branch(branch->name, &buf)) { + if ((ret = interpret_nth_last_branch(branch->name, &buf)) + && ret == strlen(branch->name)) { branch->name = xstrdup(buf.buf); strbuf_splice(&buf, 0, 0, "refs/heads/", 11); } else { |