summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e5f4e21)
raw | patch | inline | side by side (parent: e5f4e21)
author | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 16 Sep 2007 06:31:26 +0000 (02:31 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 19 Sep 2007 10:22:31 +0000 (03:22 -0700) |
If we are running fetch in a repository that has a detached HEAD
then there is no current_branch available. In such a case any ref
that the fetch might update by definition cannot also be the current
branch so we should always bypass the "don't update HEAD" test.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
then there is no current_branch available. In such a case any ref
that the fetch might update by definition cannot also be the current
branch so we should always bypass the "don't update HEAD" test.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fetch.c | patch | blob | history |
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 300d5635b09ff123918a2c5797c121223b8d70cb..d9272edae92921f51f139e5e60c89882f07bc362 100644 (file)
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
return 0;
}
- if (!strcmp(ref->name, current_branch->name) &&
+ if (current_branch &&
+ !strcmp(ref->name, current_branch->name) &&
!(update_head_ok || is_bare_repository()) &&
!is_null_sha1(ref->old_sha1)) {
/*