diff options
author | Michael Kelly <mkelly@arista.com> | 2020-07-21 19:40:38 -0700 |
---|---|---|
committer | Michael Kelly <mkelly@arista.com> | 2021-09-28 20:12:00 +0000 |
commit | 2f3c3316e497faafa1e6f3e9cb40828d0eeb9812 (patch) | |
tree | 879470f435e54f3095424c632ae149fb4adb1186 /manifest_xml.py | |
parent | 37c21c268badc2602a827d2236027e235fff95e0 (diff) | |
download | git-repo-2f3c3316e497faafa1e6f3e9cb40828d0eeb9812.tar.gz |
Update revisionId if required when using extend-project
When a hard revision ID is provided in a regular project tag then the
revisionId is updated as well if it is a commit hash. The difference
is that if the revisionExpr is a commit, git-repo needs to update
refs/remotes/m/master with update-ref not symbolic-ref, as the latter
must refer to another ref, not to a specific commit.
Change-Id: I215a62dabb30225e480ad2c731416d775fc0c750
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/310963
Tested-by: Michael Kelly <mkelly@arista.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'manifest_xml.py')
-rw-r--r-- | manifest_xml.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index 39656975..68ead53c 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
@@ -887,13 +887,11 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | |||
887 | if groups: | 887 | if groups: |
888 | p.groups.extend(groups) | 888 | p.groups.extend(groups) |
889 | if revision: | 889 | if revision: |
890 | p.revisionExpr = revision | 890 | p.SetRevision(revision) |
891 | if IsId(revision): | 891 | |
892 | p.revisionId = revision | ||
893 | else: | ||
894 | p.revisionId = None | ||
895 | if remote: | 892 | if remote: |
896 | p.remote = remote.ToRemoteSpec(name) | 893 | p.remote = remote.ToRemoteSpec(name) |
894 | |||
897 | if dest_path: | 895 | if dest_path: |
898 | del self._paths[p.relpath] | 896 | del self._paths[p.relpath] |
899 | relpath, worktree, gitdir, objdir, _ = self.GetProjectPaths(name, dest_path) | 897 | relpath, worktree, gitdir, objdir, _ = self.GetProjectPaths(name, dest_path) |