Merge pull request #93 from imsky/main

Add support for main branch as root
This commit is contained in:
Ivan Malopinsky
2020-10-27 19:24:51 -04:00
committed by GitHub
3 changed files with 10 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2017-2019 Ivan Malopinsky
Copyright (c) 2017-2020 Ivan Malopinsky
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+8 -1
View File
@@ -159,7 +159,14 @@ fi
ERR="could not get top-level-directory"
TOP_LEVEL_DIRECTORY=$(git rev-parse --show-toplevel)
REMOTE=${1:-origin}
ROOT=${2:-master}
ROOT_GUESS=master
if [[ -n $(git show-ref refs/heads/main) && -z $(git show-ref refs/heads/master) ]]; then
ROOT_GUESS=main
fi
ROOT=${2:-$ROOT_GUESS}
# Recover the root HEAD if it is missing or corrupt (e.g. master head reads "master")
recover_root () {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "git-fresh",
"version": "1.12.1",
"version": "1.13.0",
"description": "Utility to keep Git repositories fresh",
"global": true,
"repo": "imsky/git-fresh",