]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
Use global GIT_WORK_TREE and GIT_DIR
authorKacper Kornet <draenog@pld-linux.org>
Mon, 28 Mar 2011 12:00:42 +0000 (13:00 +0100)
committerKacper Kornet <draenog@pld-linux.org>
Mon, 28 Mar 2011 12:59:23 +0000 (13:59 +0100)
builder.sh

index 6dd722e6be676cf8c005d189e561f3dcaca0b46c..202f4688c7993e4fd5e11f250650653b7527fe89 100755 (executable)
@@ -713,6 +713,8 @@ init_builder() {
                REPO_DIR="."
                PACKAGE_DIR="."
        fi
+       export GIT_WORK_TREE=$PACKAGE_DIR
+       export GIT_DIR=$PACKAGE_DIR/.git
 
        __PWD=$(pwd)
 }
@@ -734,7 +736,7 @@ get_spec() {
 
        if [ "$NOCVSSPEC" != "yes" ]; then
                if [ -d "$ASSUMED_NAME/.git" ]; then
-                       GIT_DIR=$PACKAGE_DIR/.git git fetch origin || Exit_error err_no_spec_in_repo
+                       git fetch origin || Exit_error err_no_spec_in_repo
                elif [ "$ADD_PACKAGE_CVS" = "yes" ]; then
                        if [ ! -r "$ASSUMED_NAME/$SPECFILE" ]; then
                                echo "ERROR: No package to add ($ASSUMED_NAME/$SPECFILE)" >&2
@@ -775,9 +777,9 @@ get_spec() {
        fi
 
        if [ -n "$CVSTAG" ]; then
-               GIT_WORK_TREE=$PACKAGE_DIR GIT_DIR=$PACKAGE_DIR/.git git checkout "$CVSTAG" || exit
-               GIT_DIR=$PACKAGE_DIR/.git git symbolic-ref -q HEAD > /dev/null &&
-                       GIT_WORK_TREE=$PACKAGE_DIR GIT_DIR=$PACKAGE_DIR/.git git merge '@{u}'
+               git checkout "$CVSTAG" || exit
+               git symbolic-ref -q HEAD > /dev/null &&
+                       git merge '@{u}'
        fi
 
        if [ ! -f "$ASSUMED_NAME/$SPECFILE" ]; then
This page took 0.043102 seconds and 4 git commands to generate.