-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip(github): scan remote dangling commits
- Loading branch information
Showing
13 changed files
with
709 additions
and
420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -637,66 +637,26 @@ func parseCommitLine(line []byte) (hash []byte, ref []byte) { | |
// ParseCommitSource s | ||
// https://git-scm.com/docs/git-log#Documentation/git-log.txt---source | ||
func parseSourceRef(ref []byte) string { | ||
<<<<<<< HEAD | ||
<<<<<<< HEAD | ||
// We don't care about 'normal' refs. | ||
if bytes.HasPrefix(ref, []byte("refs/heads/")) || bytes.HasPrefix(ref, []byte("refs/tags/")) { | ||
======= | ||
// Remove the `refs/heads/thog` prefix. | ||
// (We don't care about refs without this prefix.) | ||
ref, ok := bytes.CutPrefix(ref, []byte("refs/heads/thog/")) | ||
if !ok { | ||
>>>>>>> 3c9809c6 (feat(gitparse): track ref sources) | ||
======= | ||
// We don't care about 'normal' refs. | ||
if bytes.HasPrefix(ref, []byte("refs/heads/")) || bytes.HasPrefix(ref, []byte("refs/tags/")) { | ||
>>>>>>> 2260e4eb (wip: use --mirror) | ||
return "" | ||
} | ||
|
||
// Handle GitHub pull requests. | ||
<<<<<<< HEAD | ||
<<<<<<< HEAD | ||
// e.g., `refs/pull/238/head` or `refs/pull/1234/merge` | ||
if after, ok := bytes.CutPrefix(ref, []byte("refs/pull/")); ok { | ||
======= | ||
// e.g., `pr/238/head` or `pr/1234/merge` | ||
if after, ok := bytes.CutPrefix(ref, []byte("pr/")); ok { | ||
>>>>>>> 3c9809c6 (feat(gitparse): track ref sources) | ||
======= | ||
// e.g., `refs/pull/238/head` or `refs/pull/1234/merge` | ||
if after, ok := bytes.CutPrefix(ref, []byte("refs/pull/")); ok { | ||
>>>>>>> 2260e4eb (wip: use --mirror) | ||
prNumber := after[:bytes.Index(after, []byte("/"))] | ||
return "Pull request #" + string(prNumber) | ||
} | ||
|
||
// Handle GitLab merge requests | ||
<<<<<<< HEAD | ||
<<<<<<< HEAD | ||
// e.g., `refs/merge-requests/238/head` or `refs/merge-requests/1234/merge` | ||
if after, ok := bytes.CutPrefix(ref, []byte("refs/merge-requests/")); ok { | ||
======= | ||
// e.g., `mr/238/head` or `mr/1234/merge` | ||
if after, ok := bytes.CutPrefix(ref, []byte("mr/")); ok { | ||
>>>>>>> 3c9809c6 (feat(gitparse): track ref sources) | ||
======= | ||
// e.g., `refs/merge-requests/238/head` or `refs/merge-requests/1234/merge` | ||
if after, ok := bytes.CutPrefix(ref, []byte("refs/merge-requests/")); ok { | ||
>>>>>>> 2260e4eb (wip: use --mirror) | ||
mrNumber := after[:bytes.Index(after, []byte("/"))] | ||
return "Merge request #" + string(mrNumber) | ||
} | ||
|
||
<<<<<<< HEAD | ||
<<<<<<< HEAD | ||
return fmt.Sprintf("%s (hidden ref)", string(ref)) | ||
======= | ||
return "" | ||
>>>>>>> 3c9809c6 (feat(gitparse): track ref sources) | ||
======= | ||
return fmt.Sprintf("%s (hidden ref)", string(ref)) | ||
>>>>>>> 2260e4eb (wip: use --mirror) | ||
} | ||
|
||
// Author: Bill Rich <[email protected]> | ||
|
Oops, something went wrong.