@matheusbsbs / matheus-bagliano / commits / 26284f9356
Fork 0

Improve error message about fetch into current branch

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>

Alex Riesen committed Mar 22, 2009 at 23:07 UTC 26284f9356f4c4d8865db8bb024121311a1f90ff
1 file changed +2 -1
builtin-fetch.c
+2 -1
@@ -544,7 +544,8 @@ static void check_not_current_branch(struct ref *ref_map)
544 for (; ref_map; ref_map = ref_map->next)
545 if (ref_map->peer_ref && !strcmp(current_branch->refname,
546 ref_map->peer_ref->name))
547 - die("Refusing to fetch into current branch");
547 + die("Refusing to fetch into current branch %s "
548 + "of non-bare repository", current_branch->refname);
549 }
550
551 static int do_fetch(struct transport *transport,