title: git clone: fatal: destination path already exists and is not an empty directory (not related to leftover files)
body: <p>I'm learning about Arch Linux packaging. I am confused by the following error:</p>
  <pre><code>Creating working copy of git repo...
  fatal: destination path already exists and is not an empty directory.
  ERROR: Failure while creating working copy of git repo
  </code></pre>
  <p>This is not related to leftover files in the directory. That seems to be the common reason for this error. However, I get the error even if I start with a completely empty directory. I have looked at all the similar questions here, and I don't think this is a duplicate of any of them.</p>
  <p>Could this be related to the fact that my project name is the same as a filename in the project? I have seen other projects that use this convention, such as: <a href="https://aur.archlinux.org/packages/chaptedit/" rel="nofollow noreferrer">https://aur.archlinux.org/packages/chaptedit/</a> . (Github url: <a href="https://github.com/helixarch/chaptedit" rel="nofollow noreferrer">https://github.com/helixarch/chaptedit</a>).</p>
  <p>My repo name is <code>myproject</code>, my project name is <code>myproject</code>, and the executable file is named <code>myproject</code>. I looked through <a href="https://wiki.archlinux.org/index.php/Arch_package_guidelines#Package_sources" rel="nofollow noreferrer">Arch package guidelines</a> and did not find anything addressing this issue. I prefer to keep the executable file name as it is.</p>
  <p>Here is the exact error:</p>
  <pre><code>$ cd myproject
  
  $ git pull
  
  remote: Enumerating objects: 5, done.
  remote: Counting objects: 100% (5/5), done.
  remote: Compressing objects: 100% (3/3), done.
  remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
  Unpacking objects: 100% (3/3), 315 bytes | 315.00 KiB/s, done.
  From xxx/test1
  3409aa3..55afd12  master     -&gt; origin/master
  Updating 8309ab3..77afd12
  Fast-forward
  PKGBUILD | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
  
  $ makepkg -s
  ==&gt; Making package: myproject 1.0-1 (Mon 05 Oct 2020 08:15:52 PM EDT)
  ==&gt; Checking runtime dependencies...
  ==&gt; Checking buildtime dependencies...
  ==&gt; Retrieving sources...
  -&gt; Cloning myproject git repo...
  Cloning into bare repository 'path/myproject'...
  remote: Enumerating objects: 52, done.
  remote: Counting objects: 100% (52/52), done.
  remote: Compressing objects: 100% (51/51), done.
  remote: Total 52 (delta 26), reused 0 (delta 0), pack-reused 0
  Receiving objects: 100% (52/52), 4.45 MiB | 3.67 MiB/s, done.
  Resolving deltas: 100% (26/26), done.
  ==&gt; Validating source files with sha256sums...
      myproject ... validated
  ==&gt; Extracting sources...
  -&gt; Creating working copy of myproject git repo...
  fatal: destination path 'myproject' already exists and is not an empty directory.
  ==&gt; ERROR: Failure while creating working copy of myproject git repo
      Aborting...
  </code></pre>