Skip to content

Commit

Permalink
Improve error message about fetch into current branch
Browse files Browse the repository at this point in the history
Otherwise, it is hard to guess why the fetch failed.
Make sure we at least mention that the repository must be bare.
Also the current branch is printed.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Alex Riesen authored and Junio C Hamano committed Mar 23, 2009
1 parent 636991b commit 26284f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builtin-fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,8 @@ static void check_not_current_branch(struct ref *ref_map)
for (; ref_map; ref_map = ref_map->next)
if (ref_map->peer_ref && !strcmp(current_branch->refname,
ref_map->peer_ref->name))
die("Refusing to fetch into current branch");
die("Refusing to fetch into current branch %s "
"of non-bare repository", current_branch->refname);
}

static int do_fetch(struct transport *transport,
Expand Down

0 comments on commit 26284f9

Please sign in to comment.