From 70e59035c0803bbed29d69fe1c535a15f0249f53 Mon Sep 17 00:00:00 2001
From: Jacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>
Date: Tue, 19 Jan 2016 21:39:48 -0500
Subject: [PATCH] Fix project find url so branch ref is not nil

Also adds autocomplete="off" to find input.
---
 app/views/layouts/header/_default.html.haml | 8 ++++++--
 app/views/projects/find_file/show.html.haml | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml
index 10f80fae3c8..b83b5b1c9b0 100644
--- a/app/views/layouts/header/_default.html.haml
+++ b/app/views/layouts/header/_default.html.haml
@@ -37,6 +37,10 @@
       %h1.title= title
 
 = render 'shared/outdated_browser'
-- if @project
+-if @project && !@project.empty_repo? && @ref
   :javascript
-    var findFileURL = '#{namespace_project_find_file_path(@project.namespace, @project, @ref || @project.repository.root_ref)}';
\ No newline at end of file
+    var findFileURL = '#{namespace_project_find_file_path(@project.namespace, @project, @ref)}';
+
+-elsif @project && !@project.empty_repo?
+  :javascript
+    var findFileURL = '#{namespace_project_find_file_path(@project.namespace, @project, @project.repository.root_ref)}';
\ No newline at end of file
diff --git a/app/views/projects/find_file/show.html.haml b/app/views/projects/find_file/show.html.haml
index 40a2a61d8a1..905f6bbbd48 100644
--- a/app/views/projects/find_file/show.html.haml
+++ b/app/views/projects/find_file/show.html.haml
@@ -10,7 +10,7 @@
         = link_to namespace_project_tree_path(@project.namespace, @project, @ref) do
           = @project.path
       %li.file-finder
-        %input#file_find.form-control.file-finder-input{type: "text", placeholder: 'Find by path'}
+        %input#file_find.form-control.file-finder-input{type: "text", placeholder: 'Find by path', autocomplete: 'off'}
 
   %div.tree-content-holder
     .table-holder
-- 
2.30.9