aboutsummaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-13 00:34:39 -0800
committerJunio C Hamano <gitster@pobox.com>2008-02-13 14:59:34 -0800
commitc0cb4a067972700f0682fbab13768bcc7dc7a3c3 (patch)
treecd372148a53a828f4beeff6f395dc3c87fab3698 /revision.c
parentcd676a513672eeb9663c6d4de276a1c860a4b879 (diff)
downloadgit-c0cb4a067972700f0682fbab13768bcc7dc7a3c3.tar.gz
git-c0cb4a067972700f0682fbab13768bcc7dc7a3c3.tar.xz
diff --relative: help working in a bare repository
This allows the --relative option to say which subdirectory to pretend to be in, so that in a bare repository, you can say: $ git log --relative=drivers/ v2.6.20..v2.6.22 -- drivers/scsi/ Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/revision.c b/revision.c
index 6d9188b6c..4d6f57b64 100644
--- a/revision.c
+++ b/revision.c
@@ -720,7 +720,7 @@ void init_revisions(struct rev_info *revs, const char *prefix)
revs->commit_format = CMIT_FMT_DEFAULT;
diff_setup(&revs->diffopt);
- if (prefix) {
+ if (prefix && !revs->diffopt.prefix) {
revs->diffopt.prefix = prefix;
revs->diffopt.prefix_length = strlen(prefix);
}