From: =?UTF-8?q?Samo=20Poga=C4=8Dnik?= <samo_pogacnik@t-2.net>
Date: Sat, 16 Nov 2024 17:47:04 +0100
Forwarded: https://github.com/ingydotnet/git-subrepo/pull/640
Subject: Fixed git-subrepo and tests if set ff_only

Some tests failed, when ff_only is set in users git configuration;
like:
...
test/branch-rev-list-one-path.t .... Died at line 23 in main of test/branch-rev-list-one-path.t
test/branch-rev-list-one-path.t .... No subtests run
test/branch-rev-list.t ............. Died at line 26 in main of test/branch-rev-list.t
test/branch-rev-list.t ............. No subtests run
...

and git configuration is set like:
    $ git config --global pull.ff only
    $ git config --global merge.ff only
---
 lib/git-subrepo                 | 2 +-
 test/branch-rev-list-one-path.t | 2 +-
 test/branch-rev-list.t          | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/git-subrepo b/lib/git-subrepo
index 6ad6bbb..5e89050 100755
--- a/lib/git-subrepo
+++ b/lib/git-subrepo
@@ -561,7 +561,7 @@ subrepo:pull() {
     fi
   else
     o "Merge in changes from $refs_subrepo_fetch"
-    FAIL=false RUN git merge "$refs_subrepo_fetch"
+    FAIL=false RUN git merge --ff "$refs_subrepo_fetch"
     if ! OK; then
       say "The \"git merge\" command failed:"
       say
diff --git a/test/branch-rev-list-one-path.t b/test/branch-rev-list-one-path.t
index afa4905..575ea8f 100644
--- a/test/branch-rev-list-one-path.t
+++ b/test/branch-rev-list-one-path.t
@@ -19,7 +19,7 @@ subrepo-clone-bar-into-foo
   add-new-files bar/file3
   add-new-files bar/file4
   add-new-files bar/file5
-  git merge master
+  git merge --ff master
 ) >& /dev/null || die
 
 test-exists "$OWNER/foo/bar/file1" "$OWNER/foo/bar/file2" "$OWNER/foo/bar/file3" "$OWNER/foo/bar/file4" "$OWNER/foo/bar/file5"
diff --git a/test/branch-rev-list.t b/test/branch-rev-list.t
index 243412c..1f39df4 100644
--- a/test/branch-rev-list.t
+++ b/test/branch-rev-list.t
@@ -22,7 +22,7 @@ subrepo-clone-bar-into-foo
   add-new-files bar/file3
   add-new-files bar/file4
   add-new-files bar/file5
-  git merge master
+  git merge --ff master
 ) >& /dev/null || die
 
 test-exists "$OWNER/foo/bar/file1" "$OWNER/foo/bar/file2" "$OWNER/foo/bar/file3" "$OWNER/foo/bar/file4" "$OWNER/foo/bar/file5"
-- 
2.45.2

