summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a1d558d)
raw | patch | inline | side by side (parent: a1d558d)
author | Brandon Casey <drafnel@gmail.com> | |
Thu, 9 Sep 2010 18:56:36 +0000 (13:56 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 10 Sep 2010 00:15:58 +0000 (17:15 -0700) |
Save future readers the trouble of tracing code to determine that the two
uses of branch->remote_name are safe when has_merge is set, by adding a
comment explaining that it is so.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
uses of branch->remote_name are safe when has_merge is set, by adding a
comment explaining that it is so.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
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 fccc9cbea38091805d656d1cbf608ae3318ea3f8..6fc50477031c9c9f7be01fee7d90266c67b38c79 100644 (file)
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
int has_merge = branch_has_merge_config(branch);
if (remote &&
(remote->fetch_refspec_nr ||
+ /* Note: has_merge implies non-NULL branch->remote_name */
(has_merge && !strcmp(branch->remote_name, remote->name)))) {
for (i = 0; i < remote->fetch_refspec_nr; i++) {
get_fetch_map(remote_refs, &remote->fetch[i], &tail, 0);
* if the remote we're fetching from is the same
* as given in branch.<name>.remote, we add the
* ref given in branch.<name>.merge, too.
+ *
+ * Note: has_merge implies non-NULL branch->remote_name
*/
if (has_merge &&
!strcmp(branch->remote_name, remote->name))