summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-27 11:55:28 -0800
committerJunio C Hamano <gitster@pobox.com>2008-02-27 11:55:28 -0800
commit860cc3a4f9c3ac21fcd37bbe30f40ab073f01299 (patch)
tree72954a742c39d14c6cc44e5524b215abab4dc7bd /revision.c
parentb82b096b8c3a29ad5115483cc8e8a433e26703ee (diff)
parentc0cb4a067972700f0682fbab13768bcc7dc7a3c3 (diff)
downloadgit-860cc3a4f9c3ac21fcd37bbe30f40ab073f01299.tar.gz
Merge branch 'jc/diff-relative'
* jc/diff-relative: diff --relative: help working in a bare repository diff --relative: output paths as relative to the current subdirectory
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/revision.c b/revision.c
index 5df7961c50..84fbdd3af4 100644
--- a/revision.c
+++ b/revision.c
@@ -738,6 +738,10 @@ void init_revisions(struct rev_info *revs, const char *prefix)
revs->commit_format = CMIT_FMT_DEFAULT;
diff_setup(&revs->diffopt);
+ if (prefix && !revs->diffopt.prefix) {
+ revs->diffopt.prefix = prefix;
+ revs->diffopt.prefix_length = strlen(prefix);
+ }
}
static void add_pending_commit_list(struct rev_info *revs,