Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  Update draft release notes for 1.6.1.1
  builtin-fsck: fix off by one head count
  t5540: clarify that http-push does not handle packed-refs on the remote
  http-push: when making directories, have a trailing slash in the path name
  http-push: fix off-by-path_len
  Documentation: let asciidoc align related options
  githooks.txt: add missing word
  builtin-commit.c: do not remove COMMIT_EDITMSG
  • Loading branch information
Junio C Hamano committed Jan 18, 2009
2 parents 5c38ea3 + 9d3043c commit 58f37f3
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 13 deletions.
7 changes: 6 additions & 1 deletion Documentation/RelNotes-1.6.1.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ Fixes since v1.6.1

* "git checkout $tree" did not trigger an error.

* "git commit" tried to remove COMMIT_EDITMSG from the work tree by mistake.

* "git describe --all" complained when a commit is described with a tag,
which was nonsense.

* "git fsck branch" did not work as advertised; instead it behaved the same
way as "git fsck".

* "git log --pretty=format:%s" did not handle a multi-line subject the
same way as built-in log listers (i.e. shortlog, --pretty=oneline, etc.)

Expand All @@ -38,7 +43,7 @@ Other documentation updates.

---
exec >/var/tmp/1
O=v1.6.1-47-g914186a
O=v1.6.1-60-g78f111e
echo O=$(git describe maint)
git shortlog --no-merges $O..maint

5 changes: 4 additions & 1 deletion Documentation/git-diff-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ OPTIONS
-------
include::diff-options.txt[]

-1 -2 -3 or --base --ours --theirs, and -0::
-1 --base::
-2 --ours::
-3 --theirs::
-0::
Diff against the "base" version, "our branch" or "their
branch" respectively. With these options, diffs for
merged entries are not shown.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/githooks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ This hook is invoked by 'git-commit' right after preparing the
default log message, and before the editor is started.

It takes one to three parameters. The first is the name of the file
that the commit log message. The second is the source of the commit
that contains the commit log message. The second is the source of the commit
message, and can be: `message` (if a `-m` or `-F` option was
given); `template` (if a `-t` option was given or the
configuration option `commit.template` is set); `merge` (if the
Expand Down
1 change: 0 additions & 1 deletion builtin-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,6 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
if (!commitable && !in_merge && !allow_empty &&
!(amend && is_a_merge(head_sha1))) {
run_status(stdout, index_file, prefix, 0);
unlink(commit_editmsg);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion builtin-fsck.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
}

heads = 0;
for (i = 1; i < argc; i++) {
for (i = 0; i < argc; i++) {
const char *arg = argv[i];
if (!get_sha1(arg, head_sha1)) {
struct object *obj = lookup_object(head_sha1);
Expand Down
15 changes: 10 additions & 5 deletions http-push.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,8 @@ static struct remote_lock *lock_remote(const char *path, long timeout)
/* Make sure leading directories exist for the remote ref */
ep = strchr(url + strlen(remote->url) + 1, '/');
while (ep) {
*ep = 0;
char saved_character = ep[1];
ep[1] = '\0';
slot = get_active_slot();
slot->results = &results;
curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1);
Expand All @@ -1223,7 +1224,7 @@ static struct remote_lock *lock_remote(const char *path, long timeout)
free(url);
return NULL;
}
*ep = '/';
ep[1] = saved_character;
ep = strchr(ep + 1, '/');
}

Expand Down Expand Up @@ -1434,10 +1435,8 @@ static void handle_remote_ls_ctx(struct xml_ctx *ctx, int tag_closed)
}
if (path) {
path += remote->path_len;
ls->dentry_name = xstrdup(path);
}
ls->dentry_name = xmalloc(strlen(path) -
remote->path_len + 1);
strcpy(ls->dentry_name, path + remote->path_len);
} else if (!strcmp(ctx->name, DAV_PROPFIND_COLLECTION)) {
ls->dentry_flags |= IS_DIR;
}
Expand All @@ -1448,6 +1447,12 @@ static void handle_remote_ls_ctx(struct xml_ctx *ctx, int tag_closed)
}
}

/*
* NEEDSWORK: remote_ls() ignores info/refs on the remote side. But it
* should _only_ heed the information from that file, instead of trying to
* determine the refs from the remote file system (badly: it does not even
* know about packed-refs).
*/
static void remote_ls(const char *path, int flags,
void (*userFunc)(struct remote_ls_ctx *ls),
void *userData)
Expand Down
2 changes: 2 additions & 0 deletions t/lib-httpd/apache.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ServerName dummy
PidFile httpd.pid
DocumentRoot www
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog access.log common
ErrorLog error.log

<IfDefine SSL>
Expand Down
24 changes: 21 additions & 3 deletions t/t5540-http-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,29 @@ test_expect_success 'clone remote repository' '
git clone $HTTPD_URL/test_repo.git test_repo_clone
'

test_expect_failure 'push to remote repository' '
test_expect_failure 'push to remote repository with packed refs' '
cd "$ROOT_PATH"/test_repo_clone &&
: >path2 &&
git add path2 &&
test_tick &&
git commit -m path2 &&
HEAD=$(git rev-parse --verify HEAD) &&
git push &&
[ -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/refs/heads/master" ]
(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
test $HEAD = $(git rev-parse --verify HEAD))
'

test_expect_failure 'create and delete remote branch' '
test_expect_success ' push to remote repository with unpacked refs' '
(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
rm packed-refs &&
git update-ref refs/heads/master \
0c973ae9bd51902a28466f3850b543fa66a6aaf4) &&
git push &&
(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
test $HEAD = $(git rev-parse --verify HEAD))
'

test_expect_success 'create and delete remote branch' '
cd "$ROOT_PATH"/test_repo_clone &&
git checkout -b dev &&
: >path3 &&
Expand All @@ -76,6 +88,12 @@ test_expect_failure 'create and delete remote branch' '
test_must_fail git show-ref --verify refs/remotes/origin/dev
'

test_expect_success 'MKCOL sends directory names with trailing slashes' '
! grep "\"MKCOL.*[^/] HTTP/[^ ]*\"" < "$HTTPD_ROOT_PATH"/access.log
'

stop_httpd

test_done

0 comments on commit 58f37f3

Please sign in to comment.