Write gitception_get in a simpler way
This commit is contained in:
parent
903e9a5bbc
commit
1a7e58db58
1 changed files with 4 additions and 4 deletions
|
@ -43,10 +43,10 @@ gitception_get()
|
||||||
local RETVAL
|
local RETVAL
|
||||||
FHEAD="$GIT_DIR/FETCH_HEAD"
|
FHEAD="$GIT_DIR/FETCH_HEAD"
|
||||||
[ -e "$FHEAD" ] && command mv -f "$FHEAD" "$FHEAD.$$~" || :
|
[ -e "$FHEAD" ] && command mv -f "$FHEAD" "$FHEAD.$$~" || :
|
||||||
git fetch -q -f "$1" HEAD:"$GREF" 2>/dev/tty >/dev/null && \
|
git fetch -q -f "$1" HEAD:"$GREF" 2>/dev/tty >/dev/null &&
|
||||||
OBJID=$(git ls-tree "$GREF" | xgrep -E "\b$2$" |
|
OBJID="$(git ls-tree "$GREF" |
|
||||||
awk '{print $3}') && [ -n "$OBJID" ] && \
|
xgrep -E "\b$2$" | awk '{print $3}')" &&
|
||||||
git cat-file blob "$OBJID" && RETVAL=: || \
|
[ -n "$OBJID" ] && git cat-file blob "$OBJID" && RETVAL=: ||
|
||||||
{ RETVAL=false && : ; }
|
{ RETVAL=false && : ; }
|
||||||
[ -e "$FHEAD.$$~" ] && command mv -f "$FHEAD.$$~" "$FHEAD" || :
|
[ -e "$FHEAD.$$~" ] && command mv -f "$FHEAD.$$~" "$FHEAD" || :
|
||||||
$RETVAL
|
$RETVAL
|
||||||
|
|
Loading…
Reference in a new issue