Search Issue Tracker

Fixed in 2021.2.X

Fix In Review for 2019.4.X, 2020.3.X

Fixed in 2021.1.X

Votes

14

Found in

2019.4.24f1

2020.3.2f1

2021.1.1f1

2021.2.0a9

Issue ID

1325920

Regression

Yes

Package resolution error when using a Git dependency referencing an annotated tag in its Git URL

Packman

-

How to reproduce:
1. Open attached project "Archive.zip"
2. Open Package Manager window
3. Add a Git dependency to the package using the tag as revision ("git+file://(absolute/path/to/pkg)#v1.0.0", for instance "git+file:///Users/maximeb/UnityProject/Archive/pkg#v1.0.0")

Expected result: The "pkg" package should be successfully added
Actual result: The package is not added to the project and an error is printed in the console:

Reproducible with - 2019.4.24f1,2020.3.2f1,2021.1.1f1,2021.2.0a9, 2021.2.0a14
Not reproducible with - 2019.4.23f1,2020.3.1f1,2021.1.0f1,2021.2.0a8

The error:
"An error occurred while resolving packages:
Project has invalid dependencies:
pkg: Error when executing git command. fatal: update_ref failed for ref 'HEAD': cannot update ref 'refs/heads/master': trying to write non-commit object 1701a603f21da447f378b943e707522dfd4d5ddc to branch 'refs/heads/master'"

  1. Response avatar

    Resolution Note (fix version 2021.2):

    Fixed in 2021.2.0a15

  2. Response avatar

    Resolution Note (fix version 2021.1):

    Fixed in: 2021.1.5f1

Comments (4)

  1. 149586f629dff8302688c6d19a6aeb00?d=mm

    achimmihca

    May 06, 2021 16:55

    > it DOESN'T work on 2021.1.5. it is still broken!

    I can confirm this. Still broken with the same error message.
    Just downloaded 2021.1.5f1 and tried it with an URL from GitHub.

  2. 2a23ae8a6507bea0f45ca0e15857f2e4?d=mm

    NemoStein

    Apr 29, 2021 13:22

    Confirmed that it work on 2021.1.0 but not in 2021.1.1.
    Also, it DOESN'T work on 2021.1.5. it is still broken!

    Trying to install a package from github (e.g.: https://github.com/org/repo.git) throws this error in the console

    [Package Manager Window] Cannot perform upm operation: Unable to add package [https://github.com/org/repo.git]:
    Could not clone [https://github.com/org/repo.git]. Revision [HEAD] could not be found. [NotFound].
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

  3. 00e03582a3fe998fb03220f78f12b658?d=mm

    denoiarsodenarsoedinsdarosdinesd

    Apr 26, 2021 12:49

    I'm experiencing the same issue as achimmihca, but with 2019.4.24f1; we have an URL like so:

    ```
    ssh://git@gitlab.com/company/repo.git#1.0.2
    ```

    And Unity keeps complaining that this tag does not exist (it does). Using a commit hash doesn't work either, nor does simply not specifying anything using the "#" symbol (then it just complains that "HEAD" cannot be found).

    I've reverted back to Unity 2019.4.18f1, where this works fine, so it must have been broken in a version in between.

  4. 149586f629dff8302688c6d19a6aeb00?d=mm

    achimmihca

    Apr 23, 2021 17:29

    In 2021.1.1f1, I have the issue always when I use the "path" parameter.
    I also tried the suggested workaround, but even with commit ID, branch name or tag name (e.g. "https://github.com/my-user/my-repo.git?path=foo/bar#revision") the issue occurs.

    Thus, the suggested workaround does not seem to work in all cases.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.