summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-06-18 10:39:17 -0700
committerJunio C Hamano <gitster@pobox.com>2009-06-18 10:39:17 -0700
commitda4e4a65a27ca912c3f48289acf9ff7a67476c3f (patch)
treef8523544be8420fd7da3c440d7ff66220f46307f
parentd978ead4c3933425f54142f2c3fab7f5071e36ef (diff)
parentef52aafa0f8b1d34f2ecd9b58f2198711c87cab3 (diff)
downloadgit-da4e4a65a27ca912c3f48289acf9ff7a67476c3f.tar.gz
Merge branch 'maint'
* maint: http.c: fix compiling with libcurl 7.9.2 import-tars: support symlinks pull, rebase: simplify to use die()
-rwxr-xr-xcontrib/fast-import/import-tars.perl17
-rwxr-xr-xgit-pull.sh6
-rwxr-xr-xgit-rebase.sh9
-rw-r--r--http.c8
4 files changed, 21 insertions, 19 deletions
diff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl
index 6309d146e7..78e40d2a13 100755
--- a/contrib/fast-import/import-tars.perl
+++ b/contrib/fast-import/import-tars.perl
@@ -82,10 +82,16 @@ foreach my $tar_file (@ARGV)
$mtime = oct $mtime;
next if $typeflag == 5; # directory
- print FI "blob\n", "mark :$next_mark\n", "data $size\n";
- while ($size > 0 && read(I, $_, 512) == 512) {
- print FI substr($_, 0, $size);
- $size -= 512;
+ print FI "blob\n", "mark :$next_mark\n";
+ if ($typeflag == 2) { # symbolic link
+ print FI "data ", length($linkname), "\n", $linkname;
+ $mode = 0120000;
+ } else {
+ print FI "data $size\n";
+ while ($size > 0 && read(I, $_, 512) == 512) {
+ print FI substr($_, 0, $size);
+ $size -= 512;
+ }
}
print FI "\n";
@@ -118,7 +124,8 @@ EOF
{
my ($mark, $mode) = @{$files{$path}};
$path =~ s,^([^/]+)/,, if $have_top_dir;
- printf FI "M %o :%i %s\n", $mode & 0111 ? 0755 : 0644, $mark, $path;
+ $mode = $mode & 0111 ? 0755 : 0644 unless $mode == 0120000;
+ printf FI "M %o :%i %s\n", $mode, $mark, $path;
}
print FI "\n";
diff --git a/git-pull.sh b/git-pull.sh
index 35261539ab..cab367ada0 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -176,13 +176,11 @@ case "$merge_head" in
?*' '?*)
if test -z "$orig_head"
then
- echo >&2 "Cannot merge multiple branches into empty head"
- exit 1
+ die "Cannot merge multiple branches into empty head"
fi
if test true = "$rebase"
then
- echo >&2 "Cannot rebase onto multiple branches"
- exit 1
+ die "Cannot rebase onto multiple branches"
fi
;;
esac
diff --git a/git-rebase.sh b/git-rebase.sh
index b83fd3f970..334629fc97 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -168,10 +168,8 @@ run_pre_rebase_hook () {
if test -z "$OK_TO_SKIP_PRE_REBASE" &&
test -x "$GIT_DIR/hooks/pre-rebase"
then
- "$GIT_DIR/hooks/pre-rebase" ${1+"$@"} || {
- echo >&2 "The pre-rebase hook refused to rebase."
- exit 1
- }
+ "$GIT_DIR/hooks/pre-rebase" ${1+"$@"} ||
+ die "The pre-rebase hook refused to rebase."
fi
}
@@ -359,8 +357,7 @@ fi
# The tree must be really really clean.
if ! git update-index --ignore-submodules --refresh; then
- echo >&2 "cannot rebase: you have unstaged changes"
- exit 1
+ die "cannot rebase: you have unstaged changes"
fi
diff=$(git diff-index --cached --name-status -r --ignore-submodules HEAD --)
case "$diff" in
diff --git a/http.c b/http.c
index 95b2137cfb..b049948245 100644
--- a/http.c
+++ b/http.c
@@ -20,7 +20,7 @@ char curl_errorstr[CURL_ERROR_SIZE];
static int curl_ssl_verify = -1;
static const char *ssl_cert;
-#if LIBCURL_VERSION_NUM >= 0x070902
+#if LIBCURL_VERSION_NUM >= 0x070903
static const char *ssl_key;
#endif
#if LIBCURL_VERSION_NUM >= 0x070908
@@ -126,7 +126,7 @@ static int http_options(const char *var, const char *value, void *cb)
}
if (!strcmp("http.sslcert", var))
return git_config_string(&ssl_cert, var, value);
-#if LIBCURL_VERSION_NUM >= 0x070902
+#if LIBCURL_VERSION_NUM >= 0x070903
if (!strcmp("http.sslkey", var))
return git_config_string(&ssl_key, var, value);
#endif
@@ -196,7 +196,7 @@ static CURL *get_curl_handle(void)
if (ssl_cert != NULL)
curl_easy_setopt(result, CURLOPT_SSLCERT, ssl_cert);
-#if LIBCURL_VERSION_NUM >= 0x070902
+#if LIBCURL_VERSION_NUM >= 0x070903
if (ssl_key != NULL)
curl_easy_setopt(result, CURLOPT_SSLKEY, ssl_key);
#endif
@@ -313,7 +313,7 @@ void http_init(struct remote *remote)
curl_ssl_verify = 0;
set_from_env(&ssl_cert, "GIT_SSL_CERT");
-#if LIBCURL_VERSION_NUM >= 0x070902
+#if LIBCURL_VERSION_NUM >= 0x070903
set_from_env(&ssl_key, "GIT_SSL_KEY");
#endif
#if LIBCURL_VERSION_NUM >= 0x070908