Skip to content

Fragile coding practices #5

Description

@AnrDaemon

The code like

	grep $short_refname "$GIT_DIR/locked"
	if [ $? -eq 0 ] ; then

is fragile - it is prone to break on future refactoring.
Also, it contains TWO other issues.

Much cleaner is to directly write what you intend the code to do:

	if grep -F "$short_refname" "$GIT_DIR/locked"; then

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions