This changes the regex to look for a hash from 7 to 40 characters,
to match the use of abbreviated hash lookups in both git and github.
The restriction of not being a pure number is also removed because
1234567 is now considered a valid abbreviated hash, as is deadbeef.
A note has been added to the top of the code to state that the
literal regex match is fine, but no extra validation is currently
performed so some false positives are expected.
A future change could ensure that the hash exists in the repository
before rendering it as a link, although this might incur a slight
performance penalty.
Reverts part of commit 4a46613 and fixes #2053.
* Use POSIX complaint ! operator in find
-not is a GNU extension and not all find(8) implementations
support it. It's just an alias for ! which is POSIX compliant.
Now gitea compiles on NetBSD at least.
* Revert change in vendor directory as requested
* Added count to GetReleasesByRepoID so pagination will work
* Separated it out to a new function, can then also leave the API part unaffected
* Remove extra whitespace added in untouched function
* Added comment and corrected name in error handler
* Account for if the user is owner or not in the count
* Also check if repo is draft
* revert back to the correct count in the ReleasesToDisplay loop
* Fixed lint error regarding else with return statement
* Use Cond struct instead of string, corrected name in error handler
* Removed unused return variable names
location.reload was being called when the related dropdown
was hidden, even if a request initiated before to update this
value hadn't finished. This caused troubles on Firefox.
* Add setting to disable authorized_keys backup when rewriting public keys
Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
* Update default value to comply with documentation
Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
* Use tmp-file instead of bak-file for saving manually added keys.
Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
* Change casing
Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
* Change casing and build bakpath with sprintf only
Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
* Only close file once
Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
* Do not modify calcFingerprint
Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
* Fix casing
Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
* Change style from disable to enable
Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
* Change name, just SSH_BACKUP_AUTHORIZED_KEYS
Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
* Do not check for directory existence if backup is disabled
Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>