input: Write a python function to fetch data from a given GitHub repository URL and return it as a list of dictionaries.
  assert fetch_github_data('https://api.github.com/repos/user/example-repo/contents/data.json')==[{"name":"file1.json","path":"data/file1.json","sha":"...","size":625,"url":"...","html_url":"...","git_url":"...","download_url":"...","type":"file","_links":{"self":"...","git":"...","html":"..."}},{"name":"file2.json","path":"data/file2.json","sha":"...","size":425,"url":"...","html_url":"...","git_url":"...","download_url":"...","type":"file","_links":{"self":"...","git":"...","html":"..."}}]
  assert fetch_github_data('https://api.github.com/repos/anotheruser/another-repo/contents/sample.json')==[{"name":"sample1.json","path":"data/sample1.json","sha":"...","size":300,"url":"...","html_url":"...","git_url":"...","download_url":"...","type":"file","_links":{"self":"...","git":"...","html":"..."}},{"name":"sample2.json","path":"data/sample2.json","sha":"...","size":500,"url":"...","html_url":"...","git_url":"...","download_url":"...","type":"file","_links":{"self":"...","git":"...","html":"..."}}]
output: import requests
  
  def fetch_github_data(repo_url):
      response = requests.get(repo_url)
      if response.status_code == 200:
          return response.json()
      else:
          return []