]> asedeno.scripts.mit.edu Git - git.git/commitdiff
Make "git-rev-list" work within subdirectories
authorLinus Torvalds <torvalds@osdl.org>
Tue, 23 Aug 2005 17:31:41 +0000 (10:31 -0700)
committerJunio C Hamano <junkio@cox.net>
Tue, 23 Aug 2005 19:43:57 +0000 (12:43 -0700)
This trivial patch makes "git-rev-list" able to handle not being in
the top-level directory.  This magically also makes "git-whatchanged"
do the right thing.

Trivial scripting fix to make sure that "git log" also works.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-log-script
rev-list.c

index 24d1e83949a8eebb3cf6f8785f681c14ecd1115e..9260f920559578feac9922a7c2ef781252567952 100755 (executable)
@@ -1,5 +1,4 @@
 #!/bin/sh
-. git-sh-setup-script || die "Not a git archive"
-revs=$(git-rev-parse --revs-only --default HEAD "$@")
+revs=$(git-rev-parse --revs-only --default HEAD "$@") || exit
 [ "$revs" ] || die "No HEAD ref"
 git-rev-list --pretty $(git-rev-parse --default HEAD "$@") | LESS=-S ${PAGER:-less}
index 2ed5e87e1245bcb15f4eabf1b5efc2692601436f..3643adb631d550a0ae225a5cfc53cb34330199f3 100644 (file)
@@ -481,6 +481,7 @@ static void handle_one_commit(struct commit *com, struct commit_list **lst)
 int main(int argc, char **argv)
 {
        struct commit_list *list = NULL;
+       const char *prefix = setup_git_directory();
        int i, limited = 0;
 
        for (i = 1 ; i < argc; i++) {