Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make test fails #5

Closed
ruifm opened this issue Feb 10, 2022 · 5 comments
Closed

make test fails #5

ruifm opened this issue Feb 10, 2022 · 5 comments

Comments

@ruifm
Copy link

ruifm commented Feb 10, 2022

Failures:

#2 (comment)

Result of:

cd test
dash completion.t -v -i
ok 53 - setup for ref completion

expecting success:
    cat >expected <<-EOF &&
    HEAD
    main
    matching-branch
    other/branch-in-other
    other/main-in-other
    matching-tag
    EOF
    (
        cur= &&
        __git_refs >"$actual"
    ) &&
    test_cmp expected "$actual"

--- expected    2022-02-10 15:26:56.628681536 +0000
+++ "/home/ruifm/repos/git-completion/test/trash directory.completion/actual"   2022-02-10 15:26:56.632014829 +0000
@@ -3,4 +3,4 @@
 matching-branch
 other/branch-in-other
 other/main-in-other
-matching-tag
+tag-in-other
not ok 54 - __git_refs - simple
#
#       cat >expected <<-EOF &&
#       HEAD
#       main
#       matching-branch
#       other/branch-in-other
#       other/main-in-other
#       matching-tag
#       EOF
#       (
#           cur= &&
#           __git_refs >"$actual"
#       ) &&
#       test_cmp expected "$actual"
#
@felipec
Copy link
Owner

felipec commented Feb 12, 2022

I investigated the test and I see no reason why it should fail.

I don't think this has anything to do with dash and it's probably something about your setup.

Can you try this simple code and paste the result?

git init -b master test-repo &&
cd test-repo &&
git init -b master otherrepo &&
git commit --allow-empty -m initial &&
git branch matching-branch &&
git tag matching-tag &&
(
  cd otherrepo &&
  git commit --allow-empty -m initial &&
  git branch -m master master-in-other &&
  git branch branch-in-other &&
  git tag tag-in-other
) &&
git remote add other "$PWD/otherrepo/.git" &&
git fetch --no-tags other &&
git for-each-ref

@ruifm
Copy link
Author

ruifm commented Feb 14, 2022

Can you try this simple code and paste the result?

Result:

Initialized empty Git repository in /tmp/test-repo/.git/
Initialized empty Git repository in /tmp/test-repo/otherrepo/.git/
[master (root-commit) 9c77662] initial
[master (root-commit) 9c77662] initial
From /tmp/test-repo/otherrepo/
 - [deleted]         (none)     -> matching-tag
 * [new branch]      branch-in-other -> other/branch-in-other
 * [new branch]      master-in-other -> other/master-in-other
 * [new tag]         tag-in-other    -> tag-in-other
9c7766294c917d925ea4d6c2ac4e828516a1bca6 commit refs/heads/master
9c7766294c917d925ea4d6c2ac4e828516a1bca6 commit refs/heads/matching-branch
9c7766294c917d925ea4d6c2ac4e828516a1bca6 commit refs/remotes/other/branch-in-other
9c7766294c917d925ea4d6c2ac4e828516a1bca6 commit refs/remotes/other/master-in-other
9c7766294c917d925ea4d6c2ac4e828516a1bca6 commit refs/tags/tag-in-other

@felipec
Copy link
Owner

felipec commented Feb 14, 2022

That's clearly wrong. Did you run that with dash? If so? What's your version of dash?

@felipec
Copy link
Owner

felipec commented Feb 15, 2022

I think this simple test should reproduce the issue:

mkdir -p other &&
(
  cd other &&
  echo "other: $PWD"
) &&
echo "current: $PWD"

@felipec
Copy link
Owner

felipec commented Jul 25, 2022

Actually, the issue might be different than what I thought.

It seems the problem is this command:

git fetch --no-tags other

It's fetching tags when it should not. Maybe you are using an old version of git, or some weird configuration.

I would need your version of git, and the output of this command git config --list.

I'm going to close this due to the lack of activity, but if you reply with the information I'll reopen.

@felipec felipec closed this as completed Jul 25, 2022
@Munzu Munzu mentioned this issue Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants