dba264 git2spec: avoid malforming of SHA-1 hashes

1 file Authored by Frantisek Sumsal 3 years ago, Committed by Packit Service 3 years ago,
1 file changed. 1 lines added. 1 lines removed.
    git2spec: avoid malforming of SHA-1 hashes
    
    When a SHA-1 hash of a specific commit is used as a tag, the regex
    shenanigans later in the script can (and will) corrupt it in certain
    cases.
    
    e.g.:
    $ perl -e '
    $tag="6e8cd92261577230daa1098f7e05ec198c3c4281";
    $tag=~s/[^0-9]+?([0-9]+)/$1/;
    print("$tag\n");
    '
    68cd92261577230daa1098f7e05ec198c3c4281
    
    (Notice the missing 'e')
    
    Let's fix this by limiting the regex's scope to a non-SHA-1 tags only.
    
    patch_name: 0026.patch
    present_in_specfile: true
    location_in_specfile: 26
    squash_commits: true
    
        
file modified
+1 -1