<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1981,6 +1981,8 @@ namespace GitCommands
 
         static public List&lt;GitHead&gt; GetRemoteHeads(string remote, bool tags, bool branches)
         {
+            remote = FixPath(remote);
+
             string tree = &quot;&quot;;
             if (tags &amp;&amp; branches)
                 tree = RunCmd(Settings.GitDir + &quot;git.cmd&quot;, &quot;ls-remote --heads --tags \&quot;&quot; + remote + &quot;\&quot;&quot;);</diff>
      <filename>GitCommands/GitCommands/Git/GitCommands.cs</filename>
    </modified>
    <modified>
      <diff>@@ -77,7 +77,7 @@
             this.Branches.FormattingEnabled = true;
             this.Branches.Location = new System.Drawing.Point(128, 19);
             this.Branches.Name = &quot;Branches&quot;;
-            this.Branches.Size = new System.Drawing.Size(297, 24);
+            this.Branches.Size = new System.Drawing.Size(297, 21);
             this.Branches.TabIndex = 5;
             this.Branches.DropDown += new System.EventHandler(this.Branches_DropDown);
             // 
@@ -86,7 +86,7 @@
             this.label2.AutoSize = true;
             this.label2.Location = new System.Drawing.Point(8, 22);
             this.label2.Name = &quot;label2&quot;;
-            this.label2.Size = new System.Drawing.Size(105, 17);
+            this.label2.Size = new System.Drawing.Size(80, 13);
             this.label2.TabIndex = 6;
             this.label2.Text = &quot;Remote branch&quot;;
             this.Tooltip.SetToolTip(this.label2, &quot;Remote branch to pull. Leave empty to pull all branches.&quot;);
@@ -118,7 +118,7 @@
             this.Merge.Checked = true;
             this.Merge.Location = new System.Drawing.Point(7, 20);
             this.Merge.Name = &quot;Merge&quot;;
-            this.Merge.Size = new System.Drawing.Size(278, 21);
+            this.Merge.Size = new System.Drawing.Size(210, 17);
             this.Merge.TabIndex = 0;
             this.Merge.TabStop = true;
             this.Merge.Text = &quot;&amp;Merge remote branch to current branch&quot;;
@@ -130,10 +130,10 @@
             this.Rebase.AutoSize = true;
             this.Rebase.Location = new System.Drawing.Point(7, 41);
             this.Rebase.Name = &quot;Rebase&quot;;
-            this.Rebase.Size = new System.Drawing.Size(542, 38);
+            this.Rebase.Size = new System.Drawing.Size(411, 30);
             this.Rebase.TabIndex = 1;
-            this.Rebase.Text = &quot;&amp;Rebase remote branch to current branch, creates linear history. It is recommended&quot; +
-                &quot;\r\nto choose a remote branch when using rebase. (use with caution)&quot;;
+            this.Rebase.Text = &quot;&amp;Rebase remote branch to current branch, creates linear history. It is recommende&quot; +
+                &quot;d\r\nto choose a remote branch when using rebase. (use with caution)&quot;;
             this.Rebase.UseVisualStyleBackColor = true;
             this.Rebase.CheckedChanged += new System.EventHandler(this.Rebase_CheckedChanged);
             // 
@@ -154,7 +154,7 @@
             this.Fetch.AutoSize = true;
             this.Fetch.Location = new System.Drawing.Point(7, 75);
             this.Fetch.Name = &quot;Fetch&quot;;
-            this.Fetch.Size = new System.Drawing.Size(280, 21);
+            this.Fetch.Size = new System.Drawing.Size(212, 17);
             this.Fetch.TabIndex = 2;
             this.Fetch.TabStop = true;
             this.Fetch.Text = &quot;Do not merge, only &amp;fetch remote branch&quot;;
@@ -167,9 +167,11 @@
             this.PullSource.FormattingEnabled = true;
             this.PullSource.Location = new System.Drawing.Point(128, 46);
             this.PullSource.Name = &quot;PullSource&quot;;
-            this.PullSource.Size = new System.Drawing.Size(297, 24);
+            this.PullSource.Size = new System.Drawing.Size(297, 21);
             this.PullSource.TabIndex = 13;
+            this.PullSource.Validating += new System.ComponentModel.CancelEventHandler(this.PullSource_Validating);
             this.PullSource.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.PullSource_DrawItem);
+            this.PullSource.SelectedIndexChanged += new System.EventHandler(this.PullSource_SelectedIndexChanged);
             this.PullSource.DropDown += new System.EventHandler(this.PullSource_DropDown);
             // 
             // Stash
@@ -187,8 +189,9 @@
             this.Remotes.FormattingEnabled = true;
             this.Remotes.Location = new System.Drawing.Point(128, 19);
             this.Remotes.Name = &quot;Remotes&quot;;
-            this.Remotes.Size = new System.Drawing.Size(297, 24);
+            this.Remotes.Size = new System.Drawing.Size(297, 21);
             this.Remotes.TabIndex = 16;
+            this.Remotes.Validating += new System.ComponentModel.CancelEventHandler(this.Remotes_Validating);
             this.Remotes.SelectedIndexChanged += new System.EventHandler(this.Remotes_SelectedIndexChanged);
             this.Remotes.Validated += new System.EventHandler(this.Remotes_Validated);
             this.Remotes.DropDown += new System.EventHandler(this.Remotes_DropDown);
@@ -223,7 +226,7 @@
             this.PullFromUrl.AutoSize = true;
             this.PullFromUrl.Location = new System.Drawing.Point(7, 47);
             this.PullFromUrl.Name = &quot;PullFromUrl&quot;;
-            this.PullFromUrl.Size = new System.Drawing.Size(47, 21);
+            this.PullFromUrl.Size = new System.Drawing.Size(38, 17);
             this.PullFromUrl.TabIndex = 19;
             this.PullFromUrl.Text = &quot;Url&quot;;
             this.Tooltip.SetToolTip(this.PullFromUrl, &quot;Url to pull from&quot;);
@@ -236,7 +239,7 @@
             this.PullFromRemote.Checked = true;
             this.PullFromRemote.Location = new System.Drawing.Point(7, 19);
             this.PullFromRemote.Name = &quot;PullFromRemote&quot;;
-            this.PullFromRemote.Size = new System.Drawing.Size(78, 21);
+            this.PullFromRemote.Size = new System.Drawing.Size(62, 17);
             this.PullFromRemote.TabIndex = 18;
             this.PullFromRemote.TabStop = true;
             this.PullFromRemote.Text = &quot;Remote&quot;;
@@ -260,7 +263,7 @@
             this.AutoStash.AutoSize = true;
             this.AutoStash.Location = new System.Drawing.Point(219, 260);
             this.AutoStash.Name = &quot;AutoStash&quot;;
-            this.AutoStash.Size = new System.Drawing.Size(97, 21);
+            this.AutoStash.Size = new System.Drawing.Size(76, 17);
             this.AutoStash.TabIndex = 20;
             this.AutoStash.Text = &quot;Auto stash&quot;;
             this.AutoStash.UseVisualStyleBackColor = true;
@@ -319,7 +322,7 @@
             // FormPull
             // 
             this.AcceptButton = this.Pull;
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(639, 290);
             this.Controls.Add(this.splitContainer1);</diff>
      <filename>GitUI/FormPull.Designer.cs</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,7 @@ using System.Drawing;
 using System.Text;
 using System.Windows.Forms;
 using System.IO;
+using GitCommands;
 
 namespace GitUI
 {
@@ -44,11 +45,14 @@ namespace GitUI
 
         private void PullSource_TextChanged(object sender, EventArgs e)
         {
-            Branches.DataSource = null;
         }
 
+        private List&lt;GitCommands.GitHead&gt; Heads = null;
+
         private void Branches_DropDown(object sender, EventArgs e)
         {
+            Cursor.Current = Cursors.WaitCursor;
+
             if ((PullFromUrl.Checked &amp;&amp; string.IsNullOrEmpty(PullSource.Text)) &amp;&amp;
                 (PullFromRemote.Checked &amp;&amp; string.IsNullOrEmpty(Remotes.Text)))
             {
@@ -56,33 +60,57 @@ namespace GitUI
                 return;
             }
 
-            string realWorkingDir = GitCommands.Settings.WorkingDir;
+            //string realWorkingDir = GitCommands.Settings.WorkingDir;
 
             try
             {
-                if (PullFromUrl.Checked)
-                {
-                    GitCommands.Settings.WorkingDir = PullSource.Text;
-                }
-                else
+                LoadPuttyKey();
+
+                if (Heads == null)
                 {
-                    GitCommands.Settings.WorkingDir = GitCommands.GitCommands.GetSetting(&quot;remote.&quot; + Remotes.Text + &quot;.url&quot;);
+                    if (PullFromUrl.Checked)
+                    {
+                        Heads = GitCommands.GitCommands.GetRemoteHeads(PullSource.Text, false, true);
+                    }
+                    else
+                    {
+                        //The line below is the most reliable way to get a list containing
+                        //all remote branches but it is also the slowest.
+                        //Heads = GitCommands.GitCommands.GetRemoteHeads(Remotes.Text, false, true);
+
+                        //The code below is a quick way to get a lost containg all remote branches.
+                        //It only returns the heads that are allready known to the repository. This
+                        //doesn't return heads that are new on the server. This can be updated using
+                        //update branch info in the manage remotes dialog.
+                        Heads = new List&lt;GitHead&gt;();
+                        foreach (GitHead head in GitCommands.GitCommands.GetHeads(true, true))
+                        {
+                            if (head.IsRemote &amp;&amp; head.Name.StartsWith(Remotes.Text, StringComparison.CurrentCultureIgnoreCase))
+                            {
+                                GitCommands.GitHead remoteHead = new GitCommands.GitHead();
+                                remoteHead.Name = head.Name.Substring(head.Name.LastIndexOf(&quot;/&quot;) + 1);
+                                Heads.Insert(0, remoteHead);
+                            }
+
+                        }
+                    }
                 }
                 Branches.DisplayMember = &quot;Name&quot;;
-                List&lt;GitCommands.GitHead&gt; heads = GitCommands.GitCommands.GetHeads(false);
 
                 GitCommands.GitHead allHead = new GitCommands.GitHead();
                 allHead.Name = &quot;*&quot;;
-                heads.Insert(0, allHead);
+                Heads.Insert(0, allHead);
                 GitCommands.GitHead noHead = new GitCommands.GitHead();
                 noHead.Name = &quot;&quot;;
-                heads.Insert(0, noHead);
-                Branches.DataSource = heads;
+                Heads.Insert(0, noHead);
+                Branches.DataSource = Heads;
             }
             finally
             {
-                GitCommands.Settings.WorkingDir = realWorkingDir;
+                //GitCommands.Settings.WorkingDir = realWorkingDir;
             }
+
+            Cursor.Current = Cursors.Default;
         }
 
         private void Pull_Click(object sender, EventArgs e)
@@ -120,13 +148,7 @@ namespace GitUI
                 source = PullSource.Text;
             else
             {
-                if (GitCommands.GitCommands.Plink())
-                {
-                    if (!File.Exists(GitCommands.Settings.Pageant))
-                        MessageBox.Show(&quot;Cannot load SSH key. PuTTY is not configured properly.&quot;, &quot;PuTTY&quot;);
-                    else
-                        GitCommands.GitCommands.StartPageantForRemote(Remotes.Text);
-                }
+                LoadPuttyKey();
                 source = Remotes.Text;
             }
 
@@ -178,6 +200,17 @@ namespace GitUI
 
         }
 
+        private void LoadPuttyKey()
+        {
+            if (GitCommands.GitCommands.Plink())
+            {
+                if (!File.Exists(GitCommands.Settings.Pageant))
+                    MessageBox.Show(&quot;Cannot load SSH key. PuTTY is not configured properly.&quot;, &quot;PuTTY&quot;);
+                else
+                    GitCommands.GitCommands.StartPageantForRemote(Remotes.Text);
+            }
+        }
+
         private void FormPull_Load(object sender, EventArgs e)
         {
             Pull.Select();
@@ -220,6 +253,7 @@ namespace GitUI
         {
             if (PullFromRemote.Checked)
             {
+                ResetRemoteHeads();
                 PullSource.Enabled = false;
                 BrowseSource.Enabled = false;
                 Remotes.Enabled = true;
@@ -231,6 +265,7 @@ namespace GitUI
         {
             if (PullFromUrl.Checked)
             {
+                ResetRemoteHeads();
                 PullSource.Enabled = true;
                 BrowseSource.Enabled = true;
                 Remotes.Enabled = false;
@@ -293,5 +328,25 @@ namespace GitUI
             PullImage.BackgroundImage = GitUI.Properties.Resources.fetch;
         }
 
+        private void PullSource_SelectedIndexChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void PullSource_Validating(object sender, CancelEventArgs e)
+        {
+            ResetRemoteHeads();
+        }
+
+        private void Remotes_Validating(object sender, CancelEventArgs e)
+        {
+            ResetRemoteHeads();
+        }
+
+        private void ResetRemoteHeads()
+        {
+            Branches.DataSource = null;
+            Heads = null;
+        }
     }
 }</diff>
      <filename>GitUI/FormPull.cs</filename>
    </modified>
    <modified>
      <diff>@@ -15,6 +15,7 @@ Version 1.79
 	Added waitcursor to FormResolveConflicts.
 	Set width to submodules submenu and recent repositories submenu.
 	Added F3 and Shift+F3 to code dialog.
+	Bug fixed that the branch drop down box in the pull dialog was empty.
 
 Version 1.78
 	Fixed bug causing the commitmessage to contain encoding marker bytes</diff>
      <filename>GitUI/Resources/ChangeLog.txt</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cfcd415a531e4c327c4e9a2f1f840dc1b029958d</id>
    </parent>
  </parents>
  <author>
    <name>Henk Westhuis</name>
    <email>Henk_Westhuis@hotmail.com</email>
  </author>
  <url>http://github.com/spdr870/gitextensions/commit/cf8f6aecd807b370b7e444a1e86133e659c14c19</url>
  <id>cf8f6aecd807b370b7e444a1e86133e659c14c19</id>
  <committed-date>2009-11-04T10:11:57-08:00</committed-date>
  <authored-date>2009-11-04T10:11:57-08:00</authored-date>
  <message>Bug fixed that the branch drop down box in the pull dialog was empty.</message>
  <tree>da94ff725643fe2118f2577a78f8dea82223740c</tree>
  <committer>
    <name>Henk Westhuis</name>
    <email>Henk_Westhuis@hotmail.com</email>
  </committer>
</commit>
