=== modified file 'breezy/git/annotate.py'
--- breezy/git/annotate.py	2018-11-11 14:23:06 +0000
+++ breezy/git/annotate.py	2019-11-17 23:21:06 +0000
@@ -100,11 +100,12 @@
             self.change_scanner.repository.lookup_bzr_revision_id(
                 text_revision))
         text_parents = []
+        path = path.encode('utf-8')
         for commit_parent in self.store[commit_id].parents:
             try:
                 (path, text_parent) = (
                     self.change_scanner.find_last_change_revision(
-                        path.encode('utf-8'), commit_parent))
+                        path, commit_parent))
             except KeyError:
                 continue
             if text_parent not in text_parents:

=== modified file 'breezy/git/filegraph.py'
--- breezy/git/filegraph.py	2018-11-11 14:23:06 +0000
+++ breezy/git/filegraph.py	2019-11-17 23:21:06 +0000
@@ -84,7 +84,7 @@
             self.change_scanner.repository.lookup_bzr_revision_id(
                 text_revision))
         try:
-            path = mapping.parse_file_id(file_id)
+            path = mapping.parse_file_id(file_id).encode('utf-8')
         except ValueError:
             raise KeyError(file_id)
         text_parents = []
@@ -92,7 +92,7 @@
             try:
                 (path, text_parent) = (
                     self.change_scanner.find_last_change_revision(
-                        path.encode('utf-8'), commit_parent))
+                        path, commit_parent))
             except KeyError:
                 continue
             if text_parent not in text_parents:

=== modified file 'breezy/git/tests/test_blackbox.py'
--- breezy/git/tests/test_blackbox.py	2019-06-16 21:40:13 +0000
+++ breezy/git/tests/test_blackbox.py	2019-11-17 23:21:06 +0000
@@ -169,6 +169,28 @@
         # Check that bzr log does not fail and includes the revision.
         output, error = self.run_bzr(['log', '-v'])
 
+    def test_log_file(self):
+        # Smoke test for "bzr log" in a git repository.
+        repo = GitRepo.init(self.test_dir)
+        builder = tests.GitBranchBuilder()
+        builder.set_file('a', b'text for a\n', False)
+        r1 = builder.commit(b'Joe Foo <joe@foo.com>', u'First')
+        builder.set_file('a', b'text 3a for a\n', False)
+        r2a = builder.commit(b'Joe Foo <joe@foo.com>', u'Second a', base=r1)
+        builder.set_file('a', b'text 3b for a\n', False)
+        r2b = builder.commit(b'Joe Foo <joe@foo.com>', u'Second b', base=r1)
+        builder.set_file('a', b'text 4 for a\n', False)
+        builder.commit(b'Joe Foo <joe@foo.com>', u'Third', merge=[r2a], base=r2b)
+        builder.finish()
+
+        # Check that bzr log does not fail and includes the revision.
+        output, error = self.run_bzr(['log', '-n2', 'a'])
+        self.assertEqual(error, '')
+        self.assertIn('Second a', output)
+        self.assertIn('Second b', output)
+        self.assertIn('First', output)
+        self.assertIn('Third', output)
+
     def test_tags(self):
         git_repo, commit_sha1 = self.simple_commit()
         git_repo.refs[b"refs/tags/foo"] = commit_sha1

=== modified file 'doc/en/release-notes/brz-3.0.txt'
--- doc/en/release-notes/brz-3.0.txt	2019-11-17 21:06:21 +0000
+++ doc/en/release-notes/brz-3.0.txt	2019-11-17 23:21:06 +0000
@@ -36,6 +36,9 @@
    significantly slow down startup on some platforms.
    (Jelmer Vernooĳ, #1832868)
 
+ * Fix file graph operations on Git repositories.
+   (Jelmer Vernooĳ, #1847913)
+
  * Allow running tests without launchpadlib installed.
    (Jelmer Vernooĳ, #1849988)
 

