Skip to content

Commit 26284f9

Browse files
raalkmlgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 636991b commit 26284f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

builtin-fetch.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,8 @@ static void check_not_current_branch(struct ref *ref_map)
544544
for (; ref_map; ref_map = ref_map->next)
545545
if (ref_map->peer_ref && !strcmp(current_branch->refname,
546546
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);
548549
}
549550

550551
static int do_fetch(struct transport *transport,

0 commit comments

Comments
 (0)