diff --git a/lib/modules/manager/pep621/processors/uv.ts b/lib/modules/manager/pep621/processors/uv.ts
index ef93bb7d21e246af1d202612c538b658a5bac4d8..4bc86b3fe8b38e8d043377db436c3721cbb80858 100644
--- a/lib/modules/manager/pep621/processors/uv.ts
+++ b/lib/modules/manager/pep621/processors/uv.ts
@@ -3,18 +3,12 @@ import { quote } from 'shlex';
 import { TEMPORARY_ERROR } from '../../../../constants/error-messages';
 import { logger } from '../../../../logger';
 import type { HostRule } from '../../../../types';
-import { detectPlatform } from '../../../../util/common';
 import { exec } from '../../../../util/exec';
 import type { ExecOptions, ToolConstraint } from '../../../../util/exec/types';
 import { getSiblingFileName, readLocalFile } from '../../../../util/fs';
-import { parseGitUrl } from '../../../../util/git/url';
 import { find } from '../../../../util/host-rules';
 import { Result } from '../../../../util/result';
 import { parseUrl } from '../../../../util/url';
-import { GitRefsDatasource } from '../../../datasource/git-refs';
-import { GitTagsDatasource } from '../../../datasource/git-tags';
-import { GithubTagsDatasource } from '../../../datasource/github-tags';
-import { GitlabTagsDatasource } from '../../../datasource/gitlab-tags';
 import { PypiDatasource } from '../../../datasource/pypi';
 import type {
   PackageDependency,
@@ -22,7 +16,8 @@ import type {
   UpdateArtifactsResult,
   Upgrade,
 } from '../../types';
-import { type PyProject, type UvGitSource, UvLockfileSchema } from '../schema';
+import { applyGitSource } from '../../util';
+import { type PyProject, UvLockfileSchema } from '../schema';
 import { depTypes, parseDependencyList } from '../utils';
 import type { PyProjectProcessor } from './types';
 
@@ -63,7 +58,13 @@ export class UvProcessor implements PyProjectProcessor {
           } else if ('workspace' in depSource) {
             dep.skipReason = 'inherited-dependency';
           } else {
-            applyGitSource(dep, depSource);
+            applyGitSource(
+              dep,
+              depSource.git,
+              depSource.rev,
+              depSource.tag,
+              depSource.branch,
+            );
           }
         }
       }
@@ -183,38 +184,6 @@ export class UvProcessor implements PyProjectProcessor {
   }
 }
 
-function applyGitSource(dep: PackageDependency, depSource: UvGitSource): void {
-  const { git, rev, tag, branch } = depSource;
-  if (tag) {
-    const platform = detectPlatform(git);
-    if (platform === 'github' || platform === 'gitlab') {
-      dep.datasource =
-        platform === 'github'
-          ? GithubTagsDatasource.id
-          : GitlabTagsDatasource.id;
-      const { protocol, source, full_name } = parseGitUrl(git);
-      dep.registryUrls = [`${protocol}://${source}`];
-      dep.packageName = full_name;
-    } else {
-      dep.datasource = GitTagsDatasource.id;
-      dep.packageName = git;
-    }
-    dep.currentValue = tag;
-    dep.skipReason = undefined;
-  } else if (rev) {
-    dep.datasource = GitRefsDatasource.id;
-    dep.packageName = git;
-    dep.currentDigest = rev;
-    dep.replaceString = rev;
-    dep.skipReason = undefined;
-  } else {
-    dep.datasource = GitRefsDatasource.id;
-    dep.packageName = git;
-    dep.currentValue = branch;
-    dep.skipReason = branch ? 'git-dependency' : 'unspecified-version';
-  }
-}
-
 function generateCMD(updatedDeps: Upgrade[]): string {
   const deps: string[] = [];
 
diff --git a/lib/modules/manager/util.spec.ts b/lib/modules/manager/util.spec.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d9e6d0e94a433a761d67f5f9cf388b03eddb779e
--- /dev/null
+++ b/lib/modules/manager/util.spec.ts
@@ -0,0 +1,100 @@
+import { GitRefsDatasource } from '../datasource/git-refs';
+import { GitTagsDatasource } from '../datasource/git-tags';
+import { GithubTagsDatasource } from '../datasource/github-tags';
+import { GitlabTagsDatasource } from '../datasource/gitlab-tags';
+import { type PackageDependency } from './types';
+import { applyGitSource } from './util';
+
+describe('modules/manager/util', () => {
+  it('applies GitHub source for tag', () => {
+    const dependency: PackageDependency = {};
+    const git = 'https://github.com/foo/bar';
+    const tag = 'v1.2.3';
+
+    applyGitSource(dependency, git, undefined, tag, undefined);
+
+    expect(dependency).toStrictEqual({
+      datasource: GithubTagsDatasource.id,
+      registryUrls: ['https://github.com'],
+      packageName: 'foo/bar',
+      currentValue: tag,
+      skipReason: undefined,
+    });
+  });
+
+  it('applies GitLab source for tag', () => {
+    const dependency: PackageDependency = {};
+    const git = 'https://gitlab.com/foo/bar';
+    const tag = 'v1.2.3';
+
+    applyGitSource(dependency, git, undefined, tag, undefined);
+
+    expect(dependency).toStrictEqual({
+      datasource: GitlabTagsDatasource.id,
+      registryUrls: ['https://gitlab.com'],
+      packageName: 'foo/bar',
+      currentValue: tag,
+      skipReason: undefined,
+    });
+  });
+
+  it('applies other git source for tag', () => {
+    const dependency: PackageDependency = {};
+    const git = 'https://a-git-source.com/foo/bar';
+    const tag = 'v1.2.3';
+
+    applyGitSource(dependency, git, undefined, tag, undefined);
+
+    expect(dependency).toStrictEqual({
+      datasource: GitTagsDatasource.id,
+      packageName: git,
+      currentValue: tag,
+      skipReason: undefined,
+    });
+  });
+
+  it('applies git source for rev', () => {
+    const dependency: PackageDependency = {};
+    const git = 'https://github.com/foo/bar';
+    const rev = 'abc1234';
+
+    applyGitSource(dependency, git, rev, undefined, undefined);
+
+    expect(dependency).toStrictEqual({
+      datasource: GitRefsDatasource.id,
+      packageName: git,
+      currentDigest: rev,
+      replaceString: rev,
+      skipReason: undefined,
+    });
+  });
+
+  it('skips git source for branch', () => {
+    const dependency: PackageDependency = {};
+    const git = 'https://github.com/foo/bar';
+    const branch = 'main';
+
+    applyGitSource(dependency, git, undefined, undefined, branch);
+
+    expect(dependency).toStrictEqual({
+      datasource: GitRefsDatasource.id,
+      packageName: git,
+      currentValue: branch,
+      skipReason: 'git-dependency',
+    });
+  });
+
+  it('skips git source for git only', () => {
+    const dependency: PackageDependency = {};
+    const git = 'https://github.com/foo/bar';
+
+    applyGitSource(dependency, git, undefined, undefined, undefined);
+
+    expect(dependency).toStrictEqual({
+      datasource: GitRefsDatasource.id,
+      packageName: git,
+      currentValue: undefined,
+      skipReason: 'unspecified-version',
+    });
+  });
+});
diff --git a/lib/modules/manager/util.ts b/lib/modules/manager/util.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3b004df339f69c4958eeef5e33d44396b635175f
--- /dev/null
+++ b/lib/modules/manager/util.ts
@@ -0,0 +1,44 @@
+import { detectPlatform } from '../../util/common';
+import { parseGitUrl } from '../../util/git/url';
+import { GitRefsDatasource } from '../datasource/git-refs';
+import { GitTagsDatasource } from '../datasource/git-tags';
+import { GithubTagsDatasource } from '../datasource/github-tags';
+import { GitlabTagsDatasource } from '../datasource/gitlab-tags';
+import type { PackageDependency } from './types';
+
+export function applyGitSource(
+  dep: PackageDependency,
+  git: string,
+  rev: string | undefined,
+  tag: string | undefined,
+  branch: string | undefined,
+): void {
+  if (tag) {
+    const platform = detectPlatform(git);
+    if (platform === 'github' || platform === 'gitlab') {
+      dep.datasource =
+        platform === 'github'
+          ? GithubTagsDatasource.id
+          : GitlabTagsDatasource.id;
+      const { protocol, source, full_name } = parseGitUrl(git);
+      dep.registryUrls = [`${protocol}://${source}`];
+      dep.packageName = full_name;
+    } else {
+      dep.datasource = GitTagsDatasource.id;
+      dep.packageName = git;
+    }
+    dep.currentValue = tag;
+    dep.skipReason = undefined;
+  } else if (rev) {
+    dep.datasource = GitRefsDatasource.id;
+    dep.packageName = git;
+    dep.currentDigest = rev;
+    dep.replaceString = rev;
+    dep.skipReason = undefined;
+  } else {
+    dep.datasource = GitRefsDatasource.id;
+    dep.packageName = git;
+    dep.currentValue = branch;
+    dep.skipReason = branch ? 'git-dependency' : 'unspecified-version';
+  }
+}