diff --git a/NEWS.rst b/NEWS.rst
index 2fa560a07a81de06d16aee3279a141e0066631f6_TkVXUy5yc3Q=..fee6008036ea97e806934c32bd46779c76311579_TkVXUy5yc3Q= 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1,3 +1,20 @@
+hg-git 1.2.1 (unreleased)
+=========================
+
+This is a minor release, focusing on bugs and compatibility.
+
+* Fix an error on pull with commits missing on Mercurial side. We'd
+  try to advance phase boundaries for them, which failed.
+
+hg-git 1.1.5 (unreleased)
+=========================
+
+This is a minor release, focusing on bugs and compatibility.
+
+* Fix an error on pull with commits missing on Mercurial side. We'd
+  try to advance phase boundaries for them, which failed.
+* Stop testing upcoming releases in CI on old stable branches.
+
 hg-git 1.2.0 (2025-02-08)
 =========================
 
diff --git a/hggit/git_handler.py b/hggit/git_handler.py
index 2fa560a07a81de06d16aee3279a141e0066631f6_aGdnaXQvZ2l0X2hhbmRsZXIucHk=..fee6008036ea97e806934c32bd46779c76311579_aGdnaXQvZ2l0X2hhbmRsZXIucHk= 100644
--- a/hggit/git_handler.py
+++ b/hggit/git_handler.py
@@ -2062,7 +2062,7 @@
             for ref_name, sha in refs.items():
                 hgsha = self.map_hg_get(sha)
 
-                if hgsha:
+                if hgsha and hgsha in self.repo.unfiltered():
                     all_remote_nodeids.add(bin(hgsha))
 
             # sanity check: ensure that all corresponding commits
diff --git a/tests/test-pull-after-strip.t b/tests/test-pull-after-strip.t
index 2fa560a07a81de06d16aee3279a141e0066631f6_dGVzdHMvdGVzdC1wdWxsLWFmdGVyLXN0cmlwLnQ=..fee6008036ea97e806934c32bd46779c76311579_dGVzdHMvdGVzdC1wdWxsLWFmdGVyLXN0cmlwLnQ= 100644
--- a/tests/test-pull-after-strip.t
+++ b/tests/test-pull-after-strip.t
@@ -7,6 +7,12 @@
   $ echo alpha > alpha
   $ git add alpha
   $ fn_git_commit -m 'add alpha'
+  $ git checkout -q --detach
+  $ echo omega > omega
+  $ git add omega
+  $ fn_git_commit -m 'add omega'
+  $ git tag theothertag
+  $ git checkout -q master
   $ echo beta > beta
   $ git add beta
   $ fn_git_commit -m 'add beta'
@@ -15,10 +21,10 @@
 
   $ cd ..
   $ hg clone -U gitrepo hgrepo
-  importing 2 git commits
-  new changesets ff7a2f2d8d70:7fe02317c63d (2 drafts)
+  importing 3 git commits
+  new changesets ff7a2f2d8d70:5403d6137622 (3 drafts)
   $ cd hgrepo
   $ hg up master
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (activating bookmark master)
   $ hg log --graph
@@ -20,10 +26,10 @@
   $ cd hgrepo
   $ hg up master
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (activating bookmark master)
   $ hg log --graph
-  @  changeset:   1:7fe02317c63d
+  @  changeset:   2:5403d6137622
   |  bookmark:    master
   |  tag:         default/master
   |  tag:         thetag
   |  tag:         tip
@@ -26,5 +32,6 @@
   |  bookmark:    master
   |  tag:         default/master
   |  tag:         thetag
   |  tag:         tip
+  |  parent:      0:ff7a2f2d8d70
   |  user:        test <test@example.org>
@@ -30,4 +37,4 @@
   |  user:        test <test@example.org>
-  |  date:        Mon Jan 01 00:00:11 2007 +0000
+  |  date:        Mon Jan 01 00:00:12 2007 +0000
   |  summary:     add beta
   |
@@ -32,5 +39,11 @@
   |  summary:     add beta
   |
+  | o  changeset:   1:6202c19d7dd9
+  |/   tag:         theothertag
+  |    user:        test <test@example.org>
+  |    date:        Mon Jan 01 00:00:11 2007 +0000
+  |    summary:     add omega
+  |
   o  changeset:   0:ff7a2f2d8d70
      user:        test <test@example.org>
      date:        Mon Jan 01 00:00:10 2007 +0000
@@ -43,7 +56,7 @@
 
   $ cd ..
   $ cd hgrepo
-  $ hg debugstrip --no-backup tip
+  $ hg debugstrip --no-backup master
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg pull
   pulling from $TESTTMP/gitrepo
@@ -51,7 +64,8 @@
   abort: you appear to have run strip - please run hg git-cleanup
   [255]
   $ hg tags
-  tip                                0:ff7a2f2d8d70
+  tip                                1:6202c19d7dd9
+  theothertag                        1:6202c19d7dd9
   $ hg git-cleanup
   git commit map cleaned
 
@@ -61,6 +75,6 @@
   pulling from $TESTTMP/gitrepo
   importing 2 git commits
   updating bookmark master
-  new changesets 7fe02317c63d:cc1e605d90db (2 drafts)
-  (run 'hg update' to get a working copy)
+  new changesets 5403d6137622:1745c5b062eb (2 drafts)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
   $ hg log --graph
@@ -66,6 +80,6 @@
   $ hg log --graph
-  o  changeset:   2:cc1e605d90db
+  o  changeset:   3:1745c5b062eb
   |  bookmark:    master
   |  tag:         default/master
   |  tag:         tip
   |  user:        test <test@example.org>
@@ -68,7 +82,7 @@
   |  bookmark:    master
   |  tag:         default/master
   |  tag:         tip
   |  user:        test <test@example.org>
-  |  date:        Mon Jan 01 00:00:12 2007 +0000
+  |  date:        Mon Jan 01 00:00:13 2007 +0000
   |  summary:     add to beta
   |
@@ -73,4 +87,4 @@
   |  summary:     add to beta
   |
-  o  changeset:   1:7fe02317c63d
+  o  changeset:   2:5403d6137622
   |  tag:         thetag
@@ -76,2 +90,3 @@
   |  tag:         thetag
+  |  parent:      0:ff7a2f2d8d70
   |  user:        test <test@example.org>
@@ -77,4 +92,4 @@
   |  user:        test <test@example.org>
-  |  date:        Mon Jan 01 00:00:11 2007 +0000
+  |  date:        Mon Jan 01 00:00:12 2007 +0000
   |  summary:     add beta
   |
@@ -79,5 +94,11 @@
   |  summary:     add beta
   |
+  | o  changeset:   1:6202c19d7dd9
+  |/   tag:         theothertag
+  |    user:        test <test@example.org>
+  |    date:        Mon Jan 01 00:00:11 2007 +0000
+  |    summary:     add omega
+  |
   @  changeset:   0:ff7a2f2d8d70
      user:        test <test@example.org>
      date:        Mon Jan 01 00:00:10 2007 +0000
@@ -86,6 +107,32 @@
 
   $ cd ..
 
+And does it affect no-op pulls of tags?
+
+  $ hg init hgrepo2
+  $ cd hgrepo2
+  $ hg pull ../gitrepo
+  pulling from ../gitrepo
+  importing 4 git commits
+  adding bookmark master
+  new changesets ff7a2f2d8d70:1745c5b062eb (4 drafts)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg debugstrip --no-backup theothertag
+  $ hg pull ../gitrepo
+  pulling from ../gitrepo
+  no changes found
+  $ hg git-cleanup
+  git commit map cleaned
+
+pull works after 'hg git-cleanup'
+
+  $ hg pull ../gitrepo
+  pulling from ../gitrepo
+  importing 1 git commits
+  new changesets 6202c19d7dd9 (1 drafts)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ cd ..
+
 Check that we also remove bad refs:
 
   $ cd hgrepo