forked from stephenh/git-central
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go back to using flat files for locking but keep them in the repo-spe…
…cific GIT_DIR.
- Loading branch information
Stephen Haberman
committed
Nov 12, 2008
1 parent
be4fac0
commit 5e1fb56
Showing
3 changed files
with
47 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
|
||
# | ||
# Checks $GIT_DIR/locked and $GIT_DIR/preserved for branches that cannot be | ||
# touched. | ||
# | ||
|
||
. $(dirname $0)/functions | ||
|
||
refname=$1 | ||
oldrev=$2 | ||
newrev=$3 | ||
|
||
# We only care about branches | ||
case "$refname" in | ||
refs/heads/*) | ||
short_refname=${refname##refs/heads/} | ||
;; | ||
*) | ||
exit 0 | ||
;; | ||
esac | ||
|
||
if test -f "$GIT_DIR/locked" ; then | ||
grep $short_refname "$GIT_DIR/locked" | ||
if [ $? -eq 0 ] ; then | ||
display_error_message "Branch $short_refname is locked" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
if test -f "$GIT_DIR/preserved" ; then | ||
grep $short_refname "$GIT_DIR/preserved" | ||
if [ $? -eq 0 ] ; then | ||
display_error_message "Branch $short_refname cannot be deleted" | ||
exit 1 | ||
fi | ||
fi | ||
|
This file was deleted.
Oops, something went wrong.
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